How can I get the player object from a tool unequipped event? Like Tool.Equipped:
Tool.Equipped:Connect(function()
local Player = game.Players:GetPlayerFromCharacter(Tool.Parent)
end)
I want to get the Player object for Tool.Unequipped.
How can I get the player object from a tool unequipped event? Like Tool.Equipped:
Tool.Equipped:Connect(function()
local Player = game.Players:GetPlayerFromCharacter(Tool.Parent)
end)
I want to get the Player object for Tool.Unequipped.
Couldn’t you just use a LocalScript
for this and access the player by doing game.Players.LocalPlayer?
Not really, because I wanted to fire a remote event
when a tool is unequipped its put in the backpack, and that’s parented to the player that owns it if Im not mistaken. You should be able to just do “Tool.Parent.Parent”
If you are firing from Client
to Server
, then you already have access to the player, if you mean to fire to Client
, then do what @GunsForGuns34 said.
Sorry, but it didn’t work.
FireClient: player argument must be a Player object
hmm strange, well could you just set the Player variable from Tool.Equipped to be a global variable then just use that?
Oh nevermind, Tool.Parent.Parent worked now.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.