|
| 11 Apr 2014 09:53 PM |
Ok, Im trying to make a script, For each player they have there own leaderstats value of rep The Rep is every second you get +1 rep added to your value and if you leave then join a new server it saves it so whatever server you join it has your previous and then starts adding +1 every second here is what i have so far :
print("Cash Stuffs running!")
function onPlayerEntered(newPlayer) wait(.5) local stats = Instance.new("IntValue") stats.Name = "leaderstats"
local cash = Instance.new("IntValue") cash.Name = "Rep" cash.Value = 0
cash.Parent = stats stats.Parent = newPlayer
end
game.Players.ChildAdded:connect(onPlayerEntered)
|
|
|
| Report Abuse |
|
|
|
| 11 Apr 2014 09:55 PM |
Oh I also added this somewhere in there or I think it was in a seperate script in the game while true do re = game.Players.LocalPlayer.leaderstats.Rep.Value re = re + 1 wait(1) end |
|
|
| Report Abuse |
|
|
|
| 11 Apr 2014 10:05 PM |
Alright, Just fixed the adding every second thing, But how do I store it? I want it to store so if the person stays for example 15 seconds, There rep is at 15 then when they leave and join new server or same one it is at 15 then keeps going.. Here is fixed script btw but i just need to store idk how that storing stuff works yet, It seems rather new..(I've been inactive for awhile)
print("Cash Stuffs running!")
function onPlayerEntered(newPlayer) wait(.5) local stats = Instance.new("IntValue") stats.Name = "leaderstats"
local cash = Instance.new("IntValue") cash.Name = "Rep" cash.Value = 0
cash.Parent = stats stats.Parent = newPlayer while true do cash.Value= cash.Value + 1 wait(1)
end end
game.Players.ChildAdded:connect(onPlayerEntered)
|
|
|
| Report Abuse |
|
|
MettaurSp
|
  |
| Joined: 20 Mar 2010 |
| Total Posts: 3179 |
|
|
| 11 Apr 2014 10:15 PM |
| Post the script and the error in Scripting Helpers. This isn't the section for help requests. |
|
|
| Report Abuse |
|
|