I have a local script that turns players invisible :
function onKeyPress(actionName, userInputState, inputObject) if userInputState == Enum.UserInputState.Begin and A == false then A = true fadeout()--super long function so I didn't include it wait(10) fadein()--super long function so I didn't include it wait(30) A = false end end game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.E)
When I put in in StarterCharacterScripts it works fine, but then my dagger local script(in a tool) stops working
local A = false function onKeyPress(actionName, userInputState, inputObject)--doesn't get past here if userInputState == Enum.UserInputState.Begin and A == false then A = true local rs = game:GetService("ReplicatedStorage") local player = game.Players.LocalPlayer local name = player.Name local o = name.."swordout" local f = rs.PlayerStuff local so = f:FindFirstChild(o) so:FireServer() wait(1) A = false end end game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.Q)
If I move the invisibility scripts out of the character it stops working and the dagger script starts working. What's wrong with my scripts?