|
| 07 Mar 2015 10:50 PM |
Hey, im trying to add player points to a game of mine, I have the localscript below in a experience system. It says in the system if blahblah.Ammount.Text = "100/100" then its got the reset thing, How can I make it give 100 player points at the same time? Ive tried the wiki for player points and can't figure it out. Thanks, Cold.
while true do local xp = script.Parent.Parent.Parent.Parent.GameInfo.Experience.Value local level = script.Parent.Parent.Parent.Parent.leaderstats.Level.Value local player = script.Parent.Parent.Parent.Parent script.Parent.Bar.XP:TweenSize(UDim2.new(xp/100,0,1,0),"Out","Quad",0.5) script.Parent.Bar.Ammount.Text = xp.."/100" script.Parent.Level.Text = level.. "" if script.Parent.Bar.Ammount.Text == "100/100" then script.Parent.Parent.Parent.Parent.GameInfo.Experience.Value = 0 script.Parent.Parent.Parent.Parent.leaderstats.Level.Value = script.Parent.Parent.Parent.Parent.leaderstats.Level.Value + 1 wait() else wait() end end
|
|
|
| Report Abuse |
|
|
| |
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
| |
|
| |
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 07 Mar 2015 11:52 PM |
local service = Game:GetService("PointsService"); PointsService:AwardPoints(player.userId, 99999); |
|
|
| Report Abuse |
|
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 07 Mar 2015 11:53 PM |
my bad
local service = Game:GetService("PointsService"); service:AwardPoints(player.userId, 99999); |
|
|
| Report Abuse |
|
|
| |
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 07 Mar 2015 11:56 PM |
local service = Game:GetService("PointsService"); service:AwardPoints(game.Players.LocalPlayer.userId, 100); |
|
|
| Report Abuse |
|
|
|
| 07 Mar 2015 11:58 PM |
Is it something in this layout?
while true do local xp = script.Parent.Parent.Parent.Parent.GameInfo.Experience.Value local level = script.Parent.Parent.Parent.Parent.leaderstats.Level.Value local player = script.Parent.Parent.Parent.Parent script.Parent.Bar.XP:TweenSize(UDim2.new(xp/100,0,1,0),"Out","Quad",0.5) script.Parent.Bar.Ammount.Text = xp.."/100" script.Parent.Level.Text = level.. "" if script.Parent.Bar.Ammount.Text == "100/100" then script.Parent.Parent.Parent.Parent.GameInfo.Experience.Value = 0 script.Parent.Parent.Parent.Parent.leaderstats.Level.Value = script.Parent.Parent.Parent.Parent.leaderstats.Level.Value + 1 local service = game:GetService("PointsService"); service:AwardPoints(player.userId, 99999); wait() else wait() end end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
ChoongJae
|
  |
| Joined: 10 Oct 2009 |
| Total Posts: 670 |
|
|
| 08 Mar 2015 12:23 AM |
| why are you using a while loop for this? |
|
|
| Report Abuse |
|
|
SMS1337
|
  |
| Joined: 19 Feb 2014 |
| Total Posts: 10504 |
|
|
| 08 Mar 2015 12:28 AM |
pointsservice only works in a server script
nice meme |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2015 12:29 AM |
| A server script is just a regular "script" correct? |
|
|
| Report Abuse |
|
|
SMS1337
|
  |
| Joined: 19 Feb 2014 |
| Total Posts: 10504 |
|
|
| 08 Mar 2015 12:34 AM |
yes
change the "while true do" to this script.Parent.Parent.Parent.Parent.GameInfo.Experience.Changed:connect(function()
remove the waits and change the last end to an "end)"
nice meme |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 08 Mar 2015 12:44 AM |
| this will be useful for my own game...hmm... |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2015 12:29 AM |
| Yeah, Ive moved this all to a server side script (Located in the gui which is in startergui) but its still not giving the points, anyone got a idea why? |
|
|
| Report Abuse |
|
|
SMS1337
|
  |
| Joined: 19 Feb 2014 |
| Total Posts: 10504 |
|
|
| 09 Mar 2015 05:09 PM |
add this below the "if script.Parent.Bar.Ammount.Text == "100/100" then" local pps = game:GetService("PointsService") pps:AwardPoints(script.Parent.Parent.Parent.Parent.UserId,100)
nice meme xdddd |
|
|
| Report Abuse |
|
|