StringValue results nil when passed through a remote event?
So I made this script that makes you delete your tools with Q, but later i realised that it would make all players delete their tools so i tried to fix it by sending a value with the player's name and if it matched the current player it would delete the tool, but whenever the event fires the returned value is nil
, help?
01 | local actionService = game:GetService( "ContextActionService" ) |
02 | local dropEvent = game.ReplicatedStorage.DropEvent |
04 | local function DropTool(actionName, inputState, inputObject) |
05 | if actionName = = "Drop" and inputState = = Enum.UserInputState.Begin then |
06 | local player = script.Parent.Parent.Name |
08 | dropEvent:FireServer(pn) |
09 | print ( "Event fired successfully. " ..pn) |
13 | actionService:BindAction( "Drop" , DropTool, false , Enum.KeyCode.Q) |
Thank you!