✓ Accepted answer
Try using game.Players.LocalPlayer? I have added a print to find the player. Basically it just finds the player name and prints it by printing plr.Name
I DON'T KNOW WHAT YOU MEAN BY: "How can i make this script find the player who activated the tool?" so I have made it print the username. And made a script you can work off.
eg.
local plr = game.Players.LocalPlayer
local clickable = true
script.Parent.Activated:Connect(function()
if clickable then
clickable = false
plr.leaderstats.Money.Value = plr.leaderstats.Money.Value + 5
plr.leaderstats.Total.Value = plr.leaderstats.Total.Value + 1
print (plr.Name)
wait(5)
clickable = true
end
end)
or work off this
local plr = game.Players.LocalPlayer
local clickable = true
script.Parent.Activated:Connect(function()
if clickable then
clickable = false
plr.leaderstats.Money.Value = plr.leaderstats.Money.Value + 5
plr.leaderstats.Total.Value = plr.leaderstats.Total.Value + 1
local playerwhodidit = plr.Name
wait(5)
clickable = true
end
end)
2 comments
game.Players.LocalPlayer?
if its a server script then then u can just get the player from the character