How do i make it so that when a sphere(goro), touches a humanoid, it causes them to take 3 damage? i tried goro.Touched:connect(function(hit) if hit.Parent == humanoid then hit:TakeDamage(3) but it won't work for some reason. Any ideas?
player = game.Players.LocalPlayer
character = player.CharacterAdded:wait()
humanoid = character:WaitForChild('Humanoid')
mouse = player:GetMouse()
local Ready = false
goroBall = Instance.new("Part", game.Workspace)
goroBall.Shape = "Ball"
goroBall.CanCollide = false
goroBall.Material = "Neon"
goroBall.BrickColor = BrickColor.new("Light blue")
goroBall.Size = Vector3.new(25,25,25)
uis = game:GetService("UserInputService")
uis.InputBegan:connect(function(input,gpe)
if input.KeyCode == Enum.KeyCode.Z and Ready == false then
Ready = true
for i = 1,8 do
wait(0.2)
local goro = goroBall:Clone()
goro.Parent = game.Workspace
goro.CFrame = character.Torso.CFrame * CFrame.new(0,0,-15)
local bv = Instance.new("BodyVelocity")
bv.MaxForce = Ve######################## bv.Velocity = character.Torso.CFrame.lookVector*100
bv.Parent = goro
uis.InputEnded:connect(function(code)
if code.KeyCode == Enum.KeyCode.Z then
wait(5)
Ready = false
wait()
goro:Destroy()
end
end)
end
end
end) |