How do I use :FireClient()?

script.Parent.Activated:Connect(function(plr)
count:FireClient(plr,batterypercent.Value)

this is a script located in a tool, and once it is activated it defines the player (plr) and I use the plr for the argument in the fireclient. But the console output says that I need a player object, but I have no idea what that means.

What is being activated, i.e. what is script.Parent?

the tool is being activated. Script.Parent is referring to the tool which is located in StarterPack.

I don’t think that .Activated() returns a player. I don’t see it anywhere in the documentation.

As polysaccharide said, the Tool.Activated event doesn’t give any parameters. Try getting the player like this:
local player = game.Players:GetPlayerFromCharacter(script:FindFirstAncestorOfClass("Model"))

2 Likes

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