So basically i have 2 local scripts, the first one plays a backflip animation when i press the F key
--//Service local CAS = game:GetService('ContextActionService') --//Variables local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:Wait() local hum = char:WaitForChild('Humanoid') --//Animation local flipAnimation = script:WaitForChild('Backflip') local load = hum:LoadAnimation(flipAnimation) --//Function function blank(actionName, inputState, input) if actionName == 'BackFlip' and inputState == Enum.UserInputState.Begin then load:Play() CAS:UnbindAction('LeftClick') end end CAS:BindAction('BackFlip', blank, false, Enum.KeyCode.F)
The second local script is located inside a tool, when i click while having the tool equipped, it will print out "working"
local CAS = game:GetService('ContextActionService') local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:Wait() local tool = script.Parent function clicked(actionName, inputState, input) if actionName == 'LeftClick' and inputState == Enum.UserInputState.Begin then print('working') end end tool.Equipped:Connect(function() CAS:BindAction('LeftClick', clicked, false, Enum.UserInputType.MouseButton1) end)
What i want to do is, i want to prevent the tool from being clickable when i do the backflip animation. This is to prevent the animations from overriding each other once i add animations to the tool when clicked. I know that i can use UnbindAction whenever i press the F key to disable to clicking but how am i suppose to enable it again from a different local script?