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 10 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.

01player = script.Parent.Parent.Parent.Parent.Parent
02coins = player.leaderstats.Coins
03price = 100
04h = h.Character.Humanoid -- Here is where I want to find the buyer
05 
06function buy()
07if coins.Value >= price then
08coins.Value = coins.Value - price
09h.Walkspeed = 20
10else
11print 'Player does not have enough coins to buy!'
12 
13end
14end
15 
16script.Parent.MouseButton1Down:connect(buy)
0
Where is the script located and what type of script is it? (Server script, local script) Spongocardo 1991 — 10y

2 answers

Log in to vote
1
Answered by
Nifer2 174
10 years ago
01player = script.Parent.Parent.Parent.Parent.Parent -- This is the buyer.
02coins = player.leaderstats.Coins
03price = 100
04h = player.Character.Humanoid -- Here is where I want to find the buyer -- You already found the player using the "player" variable.
05 
06function buy()
07    if coins.Value >= price then
08        coins.Value = coins.Value - price
09        h.WalkSpeed = 20 -- Walkspeed should be spelled as "WalkSpeed". Fixed this for you.
10    else
11        print 'Player does not have enough coins to buy!'
12    end
13end
14 
15script.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...

1player = 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 — 10y
0
Yeah, it should work. Is the script working? Nifer2 174 — 10y
Ad
Log in to vote
0
Answered by 10 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 — 10y
0
I can manage if its a gamepass but it's not. chill22518 145 — 10y
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 — 10y

Answer this question