generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

What am I doing wrong for this script?

Previous Thread :: Next Thread 
CordlessTub is not online. CordlessTub
Joined: 12 Apr 2012
Total Posts: 2297
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
CordlessTub is not online. CordlessTub
Joined: 12 Apr 2012
Total Posts: 2297
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
CordlessTub is not online. CordlessTub
Joined: 12 Apr 2012
Total Posts: 2297
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image