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

"CanDamage is not a valid member of Tool" HELP?

Asked by 7 years ago

The Animation works in studio but not in the game itself for it also works in my Showcase game, in the game itself, which is confusing, The damage isn't working as stated in the title. If anyone could help me on this it'd be great. Thanks

Script


script.Parent.Blade.Touched:connect(function(p) if script.Parent.Damage.Value == true then script.Parent.Damage.Value = false p.Parent.Humanoid:TakeDamage(20) end end)

Local Script


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)
1
Are you sure CanDamage is inside tool? GuestRealization 102 — 7y
0
Wow thanks, I completely forgot about putting one in. Can you explain the reason for the animation though, that's what's really bothering me, it works in all my other games but not the Tycoon I want it in. Unkn0wn_Species 20 — 7y
0
You could try defining the AnimationTrack prior to the event firing. If that doesn't work then you could try playing the anims on the server with a RemoteEvent, but you shouldn't have to do that cause Character replication. Goulstem 8144 — 7y
0
What do you mean by "Defining the AnimationTrack" how exactly would I do that? Unkn0wn_Species 20 — 7y
View all comments (2 more)
0
In your LocalScript, the `attack` variable would be your AnimationTrack. Define it outside of the event to "preload" the animation in a sense. You can read more about AnimationTracks here: http://wiki.roblox.com/index.php?title=Animations#AnimationTrack Goulstem 8144 — 7y
0
thanks Unkn0wn_Species 20 — 7y

Answer this question