How can I get the player object from a tool unequipped event?

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.

1 Like

Couldn’t you just use a LocalScript for this and access the player by doing game.Players.LocalPlayer?

1 Like

Not really, because I wanted to fire a remote event

1 Like

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”

1 Like

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.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.