I want to find the buyer of an item I put in my game but I don't know how. this script should allow the buyer to go faster.
player = script.Parent.Parent.Parent.Parent.Parent
coins = player.leaderstats.Coins
price = 100
h = h.Character.Humanoid -- Here is where I want to find the buyer
function buy()
if coins.Value >= price then
coins.Value = coins.Value - price
h.Walkspeed = 20
else
print 'Player does not have enough coins to buy!'
end
end
script.Parent.MouseButton1Down:connect(buy)

1 comment
Where is the script located and what type of script is it? (Server script, local script)