Why does this script stop another script from working when in the player's Character?
I have a local script that turns players invisible :
01 | function onKeyPress(actionName, userInputState, inputObject) |
02 | if userInputState = = Enum.UserInputState.Begin and A = = false then |
11 | 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
02 | function onKeyPress(actionName, userInputState, inputObject) |
03 | if userInputState = = Enum.UserInputState.Begin and A = = false then |
05 | local rs = game:GetService( "ReplicatedStorage" ) |
06 | local player = game.Players.LocalPlayer |
07 | local name = player.Name |
08 | local o = name.. "swordout" |
09 | local f = rs.PlayerStuff |
10 | local so = f:FindFirstChild(o) |
16 | 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?