This is in a tool in a local script, and it doesn't give any output. It's supposed to play an animation and clones something from replicated storage but it doesn't work. It uses context action service in case the tool is unequipped. I changed server storage to replicated storage because local script, I removed the stamina check to make it simpler, I parented the animation to the char, and now there's no output but it still doesn't work. Anyone know what's wrong with it?
01 | --Normal variable setup |
02 | local player = game.Players.LocalPlayer |
03 | local char = player.Character |
04 | local debounce = false |
05 |
06 | --Setting up the animation |
07 | local animation = Instance.new( "Animation" ) |
08 | animation.Parent = script.Parent.Parent |
09 | animation.AnimationId = "http://www.roblox.com/Asset?ID=21488069" |
10 | local animTrack = char.Humanoid:LoadAnimation(animation) |
11 | --Context Action Service |
12 | local CAS = game:GetService( "ContextActionService" ) |
13 |
14 | --Actual function I want to happen |
15 | function firewall() |
Thanks for the help.
I'm not 100% sure about this, so please don't downvote, but I think line 29 should be CAS:BindActionToInputTypes("wall", firewall(), false, Enum.KeyCode.R)
I just came up with this answer by reading the wiki.