Hi i have a script to do damage and because this error even my animation is not working. Can you guys help me?
ActionSwing(Animation) Local script
Player = game.Players.LocalPlayer
local RS = game:GetService("ReplicatedStorage")
local OnTouch = RS:WaitForChild("OnDamage")
game.Workspace:WaitForChild(Player.Name)
Stone = script.Parent
Anim = game.Lighting.Animations.StoneSwing
Track = Player.Character.Humanoid:LoadAnimation(Anim)
Anim = false
Debounce = false
Stone.Activated:Connect(function()
if Debounce == false then
Debounce = true
Track:Play()
wait(0.3)
Anim = true
wait(0.8)
Anim = false
wait(0.2)
Debounce = false
end
end)
Stone.Unequipped:Connect(function()
Track:Stop()
end)
OnTouch script
Player = game.Players.LocalPlayer
game.Workspace:WaitForChild()
Stone = game.StarterPack.Stone
local Damage = 10
Anim = game.Lighting.Animations.StoneSwing
Hitted = false
function OnTouch(part)
if part.Parent:FindFirstChild("Humanoid") ~= nil and part.Parent.Name ~= Player.Name and Anim == true and Hitted == false then
Hitted = true
Damage = 10
Stone.OnDamage:FireServer(Damage, part)
wait(0.4)
Hitted = false
end
end
(ServerScriptService) StoneDamage(Script)
local RS = game:GetService("ReplicatedStorage")
local Remote = RS:WaitForChild("OnDamage")
local stone = game.StarterPack.Stone
Remote.OnServerEvent:Connect(function(Player,Damage,part)
part.Parent:FindFirstChild("Humanoid"):TakeDamage(Damage)
end)

2 comments
How much should i put?
The longest you think that it will take for RS.OnDamage to load. Having too big numbers doesn't really make a difference if the child is guaranteed to load. However, if, fore some reason, the child doesn't load at all (doesn't exist), it will take that much time until the script finally errors out. Usually I would put 60 seconds, but very, very large places (in amount of parts) may require more.