Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

No output, but animation script still doesn't work?

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?

--Normal variable setup
local player = game.Players.LocalPlayer
local char = player.Character
local debounce = false

--Setting up the animation 
local animation = Instance.new("Animation")
animation.Parent = script.Parent.Parent
animation.AnimationId = "http://www.roblox.com/Asset?ID=21488069"
local animTrack = char.Humanoid:LoadAnimation(animation)
--Context Action Service
local CAS = game:GetService("ContextActionService")

--Actual function I want to happen
function firewall()
if debounce  then return end
local CF = game.ReplicatedStorage.Wall:Clone()
CF.Parent = script.Parent
CF.MainPart.Position = char.Torso.Position + Vector3.new(5,0,0)
CF.MainPart.Rotation = char.Torso.Rotation
animTrack:Play()
debounce = true
wait(5)
debounce = false
end


script.Parent.Equipped:connect(function()
CAS:BindActionToInputTypes("wall", firewall, false, "r") 
end)

script.Parent.Unequipped:connect(function()
CAS:UnbindAction("wall")
end)

Thanks for the help.

1 answer

✓ Accepted answer

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.

8 comments

0

^I know, people downvote for even the simplest mistake even if it's their own fault. I helped someone with just 1 error in his script, there were more but I helped him with one and he was like "doesn't wurk" and downvoted me. But yeah, I'll try that when I get home. Thanks!

0

Please upvote.

0

Lol ok. If this answer ends up working, please mark it as accepted and upvote.

0

I can't upvote until my reputation gets higher which requires upvotes. Upvote me and I'll upvote you.

0

Doesn't work, downvoting. Just kidding.

0

Maybe you should learn more about how to script before you post answers that get downvoted. Just saying

0

I'm at an intermedate level it's just I don't always have access to studio.

0

I'm a high level scripter, so I can script without having to test it

This discussion is preserved as it was. New answers, comments, and votes are closed.