Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Weapons animation works in studio but not in the server How to fix? [closed]

Asked by 7 years ago

This question already has an answer here:

"CanDamage is not a valid member of Tool" HELP?
local CanAttack = true





script.Parent.Activated:connect(function()

local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)



if CanAttack == true then

attack:Play()

CanAttack = false

wait(1)

attack:Stop()

CanAttack = true

script.Parent.CanDamage.Value = true

end

end)

(error)

local CanAttack = true





script.Parent.Activated:connect(function()

local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)



if CanAttack == true then

attack:Play()

CanAttack = false

wait(1)

attack:Stop()

CanAttack = true

:7: attempt to index global 'script' (a nil value)

Marked as Duplicate by Goulstem

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?