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?
local actionService = game:GetService("ContextActionService") local dropEvent = game.ReplicatedStorage.DropEvent local function DropTool(actionName, inputState, inputObject) if actionName == "Drop" and inputState == Enum.UserInputState.Begin then local player = script.Parent.Parent.Name pn = player dropEvent:FireServer(pn) print("Event fired successfully. "..pn) end end actionService:BindAction("Drop", DropTool, false, Enum.KeyCode.Q)
Thank you!