Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Trading out Player Points for in-Game Credits?

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

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

4 comments

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?

2

Then you would add "* 5" after game.Players.LocalPlayer.Credits.Value, so you'd multiply the amount.

1

Then replace the second argument in the AwardPoints method with 'cr*5'.

0

thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.