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

Context action service script still doesn't work?

Asked by
yoshiegg6 176
9 years ago

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? I used Context Action Service in this script if you need to read up on it. Is it a problem with animations or...?

--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 = char
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)
0
I already gave you a fix on your last post. Try it, please. yumtaste 476 — 9y
0
I did, like I said it didn't work. the parentheses to call firewall and the enum keycode didn't work. yoshiegg6 176 — 9y
0
Oh, ok. I didn't get the alert. yumtaste 476 — 9y
0
Do you know whats wrong with it? yoshiegg6 176 — 9y

Answer this question