Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how can you find the buyer of an item?

Asked by 9 years ago

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)
0
Where is the script located and what type of script is it? (Server script, local script) Spongocardo 1991 — 9y

2 answers

Log in to vote
1
Answered by
Nifer2 174
9 years ago
player = script.Parent.Parent.Parent.Parent.Parent -- This is the buyer.
coins = player.leaderstats.Coins
price = 100
h = player.Character.Humanoid -- Here is where I want to find the buyer -- You already found the player using the "player" variable.

function buy()
    if coins.Value >= price then
        coins.Value = coins.Value - price
        h.WalkSpeed = 20 -- Walkspeed should be spelled as "WalkSpeed". Fixed this for you.
    else
        print 'Player does not have enough coins to buy!'
    end 
end

script.Parent.MouseButton1Down:connect(buy)

At the top of your script, the "player" variable that you set should be the buyer, right? Also, like I said in your other thread (I mean question), the "Walkspeed" needs to have a capital s. If you are using a LocalScript, you can find the player through...

player = game.Players.LocalPlayer -- Instead of script.Parent.Parent.Parent.Parent.Parent.
0
So it was the WalkSpeed thanks! Would it work if I do player.Humanoid.WalkSpeed? chill22518 145 — 9y
0
Yeah, it should work. Is the script working? Nifer2 174 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

well if its a gamepass u can go to trade, transections and sales but sorry i dont know for thing bought for the game currency, but its pretty easy to tell who has walkspeed 20 because its about 5 more speed than usaul

0
Umm, I don't think you know what you or they are talking about. They're talking about an item in their game, not on the ROBLOX website. Lightdrago 95 — 9y
0
I can manage if its a gamepass but it's not. chill22518 145 — 9y
0
ik hats what i said, im not sure how to check if someone had bought the item from the game but its not that hard to tell if the person has extra speed or not iamnoamesa 674 — 9y

Answer this question