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

How do i make a sell script give coins for fat?

Asked by 5 years ago

i want it to sell Fat in return for Coins but idk how

0
do you even try 123nabilben123 499 — 5y
0
and im confused if you mean a simulator type game displaying fat on leaderboards 123nabilben123 499 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

I see what game your making, an "Eat Junk and Get Fat" simulator, how original.
Anyways, You need to decide how much coins a player would get. An example would be fat / 2 would equal how many coins the player would get. So here would be the code:

--Event goes here
local p = game.Players.LocalPlayer
p.leaderstats.Coins.Value = p.leaderstats.Fat.Value / 2 --Again, replace 2 with any number.
--end)

Make a new script with this code:

game.Players.PlayersAdded:Connect(function(plr)
Instance.new("Folder",plr).Name = "leaderstats"
Instance.new("IntValue",plr.leaderstats).Name = "Coins"
Instance.new("IntValue",plr.leaderstats).Name = "Fat"
end)

Happy Devolping! Vivilian9

0
To note: this is unsafe from exploiters unless the leaderstats info is copied from elsewhere, and all uses of the info is from that elsewhere location. AwesomeUniverseYT 56 — 5y
0
What do you mean? Exploiters' commands are ran from a localscript, so it's value isn't changed to the server. ViviTheLuaKing 103 — 5y
Ad

Answer this question