Question: local replicatedStorage = game:GetService ( ReplicatedStorage ) - - Find the RemoteEvent instead of waiting for it local remoteEvent = replicatedStorage:FindFirstChild (
local replicatedStorage game:GetServiceReplicatedStorage
Find the RemoteEvent instead of waiting for it
local remoteEvent replicatedStorage:FindFirstChildShootProjectileEvent
if not remoteEvent then
errorShootProjectileEvent not found in ReplicatedStorage."
return
end
local function onShootProjectileplayer direction, origin
local projectile replicatedStorage:FindFirstChildBlastWizard"
if not projectile then
errorBlastWizard projectile not found in ReplicatedStorage."
return
end
local newProjectile projectile:Clone
newProjectile.Parent game.Workspace
newProjectile.Position origin
Serverside logic for projectile behavior
local function onTouchedhit
local hitHumanoid hit.Parent:FindFirstChildOfClassHumanoid
if hitHumanoid and hit.Parent ~ player.Character then
hitHumanoid:TakeDamage Adjust the damage as needed
newProjectile:Destroy
elseif hit.Parent:IsATerrain then
newProjectile:Destroy
end
end
newProjectile.Touched:ConnectonTouched
wait
newProjectile:Destroy
end
remoteEvent.OnServerEvent:ConnectonShootProjectile
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
