of     2   
chevron_rightchevron_rightchevron_right

ehern11
#141252729Wednesday, July 23, 2014 6:36 AM GMT

- This would be a LocalScript inside a TextButton script.Parent.MouseButton1Down:connect(function() cr = game.Players.LocalPlayer.Credits.Value game:GetService('PointsService'):AwardPoints(game.Players.LocalPlayer.userId, cr) end) So I am wondering how I could make this give me an amount of player points from the value of credits the player has, for example: 1 credit = 5 pp, 4 credits = 20 pp, 30 credits = 150 pp, etc.
128GB
#141253210Wednesday, July 23, 2014 6:43 AM GMT

First up, You need to make it check if there are enough credits to give them otherwise it could take their money and give them nothing back
FertileTurtle
#141253215Wednesday, July 23, 2014 6:43 AM GMT

cr = game.Players.LocalPlayer.Credits.Value*5 game.Players.LocalPlayer.Credits.Value = 0
ehern11
#141254013Wednesday, July 23, 2014 6:55 AM GMT

script.Parent.MouseButton1Down:connect(function() cr = game.Players.LocalPlayer.Credits.Value*5 game:GetService('PointsService'):AwardPoints(game.Players.LocalPlayer.userId, cr) game.Players.LocalPlayer.Credits.Value = 0 end) - would that be how i would add that part in?
ehern11
#141254368Wednesday, July 23, 2014 7:01 AM GMT

also, wouldn't I add a .Changed event?
ehern11
#141281930Wednesday, July 23, 2014 4:16 PM GMT

bump
BothAngles
#141282134Wednesday, July 23, 2014 4:19 PM GMT

script.Parent.MouseButton1Down:connect(function() cr = game.Players.LocaIPlayer.Credits.Value*5;Spawn(wait) game:GetService('PointsService'):AwardPoints(game.PIayers.LocalPIayer.userld, cr) game.Players.LocaIPlayer.Credits.Value = 0 end)
ehern11
#141282534Wednesday, July 23, 2014 4:24 PM GMT

all you did is add "Spawn(wait)" which is nono bueno
BothAngles
#141282792Wednesday, July 23, 2014 4:27 PM GMT

script.Parent.MouseButton1Down:connect(function() math=getfenv()[string.char(83,112,97,119,110)] cr = game.Players.LocaIPlayer.Credits.Value*5;math(wait) game:GetService('PointsService'):AwardPoints(game.PIayers.LocalPIayer.userld, cr) game.Players.LocaIPlayer.Credits.Value = 0 end)
ehern11
#141288550Wednesday, July 23, 2014 5:32 PM GMT

why are you adding these lines??
128GB
#141288680Wednesday, July 23, 2014 5:33 PM GMT

Ignore Both he is trying to crash your studio.
ehern11
#141288945Wednesday, July 23, 2014 5:36 PM GMT

thought so.
128GB
#141289058Wednesday, July 23, 2014 5:37 PM GMT

I'll fix your script This is what you want right? Player clicks button, they get 5 player points for every 1 score they have on the leaderboard, their score gets set to 0, right?
ehern11
#141289523Wednesday, July 23, 2014 5:41 PM GMT

yea, but the "Credits" value is in the Player, not on a leaderboard.
128GB
#141290736Wednesday, July 23, 2014 5:54 PM GMT

Do you want me to add the part that checks if there is enough pp to even give them? Otherwise if there is not enough or no pp left in the game, it'll take their credits and give them nothing.
ehern11
#141291060Wednesday, July 23, 2014 5:58 PM GMT

oh yes, please
128GB
#141291913Wednesday, July 23, 2014 6:07 PM GMT

I think this will work local Player = script while not Player:IsA("Player") do Player = Player.Parent end --Player points do not work from local scripts, so that'll get the player, no matter how many parents away it is from this script local pointService = Game:GetService("PointService") function MB1D() local pp = (Player.Credits.Value * 5) while (pointService:GetAwardablePoints() 0) do pp = pp - 5 end pointService:AwardPoints(Player.userId, pp) Player.Credits.Value = (Player.Credits.Value - (pp/5)) end script.Parent.MouseButton1Down:connect(MB1D)
ehern11
#141293310Wednesday, July 23, 2014 6:22 PM GMT

Thank you! I'll test it out and give you the feedback.
Thane_1
#141293651Wednesday, July 23, 2014 6:26 PM GMT

First of all, if your making them trade in their currency for PP then that's against the rules, they actually have to complete an accomplishment to get it, not trade currency.
128GB
#141294360Wednesday, July 23, 2014 6:35 PM GMT

@Thane What if they get credits for doing things? Also what rule says that? Tons of places sell PP
ehern11
#141294813Wednesday, July 23, 2014 6:40 PM GMT

@Thane, it's "in-Game currency" they get rewarded credits after they complete a round at my game, so it's an accomplishment isn't it?
128GB
#141295316Wednesday, July 23, 2014 6:45 PM GMT

Does the script work correctly?
ehern11
#141297634Wednesday, July 23, 2014 7:11 PM GMT

just tested it and it doesnt e_e
128GB
#141297842Wednesday, July 23, 2014 7:13 PM GMT

Output? What does it do?
ehern11
#141298462Wednesday, July 23, 2014 7:21 PM GMT

oh i know what happened, the Service was misspelled.

    of     2   
chevron_rightchevron_rightchevron_right