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

Trading out Player Points for in-Game Credits?

Asked by
ehern11 15
10 years ago

So first of all, I'm typing on an Ipad, please bare with me.

So if I were to make a SurfaceGui with a Frame + TextButton, how would I make it trade any amount of credits you have for a certain amount of Player Points, like, for example; I have 12 Credits and I want to trade those for Player Points, how exactly would I make it do that?

I know how to function the script, but not that part exactly.

1 answer

Log in to vote
8
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
10 years ago

Sooo.. say you have a gui that exchanges all your credits to playerpoints when you click it..

Gui.MouseButton1Down:connect(function()
    cr  = game.Players.LocalPlayer.Credits.Value
    game:GetService('PointsService'):AwardPoints(game.Players.LocalPlayer.userId, cr)
end)

LocalScript, assuming that the in game credit values are stored in the player..

Hope I Helped

+1

0
thanks, but what if I'd like to exchange it for a value greater than the credits value, like 1 credit = 5 pp, 2 = 10 pp, 3 = 15, etc. without having to make a long script that has every specific exchange? ehern11 15 — 10y
2
Then you would add "* 5" after game.Players.LocalPlayer.Credits.Value, so you'd multiply the amount. TofuBytes 500 — 10y
1
Then replace the second argument in the AwardPoints method with 'cr*5'. Goulstem 8144 — 10y
0
thanks! ehern11 15 — 10y
Ad

Answer this question