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 » Scripting Helpers
Home Search
 

Re: o_O Wrong?

Previous Thread :: Next Thread 
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
08 Sep 2011 03:30 PM

repeat wait() until game.Players.LocalPlayer:FindFirstChild("leaderstats") ~= nil
totalko = game.Players.LocalPlayer.leaderstats.KOs
totalwo = game.Players.LocalPlayer.leaderstats.KOs
totalscore = game.Players.LocalPlayer.leaderstats.Score
function changed()
KO = game.Players.LocalPlayer.CurrentValue.CurrentKO
WO = game.Players.LocalPlayer.CurrentValue.CurrentWO
Score = game.Players.LocalPlayer.CurrentValue.CurrentScore
realKO = game.Players.LocalPlayer.leaderstats.KOs.Value
realWO = game.Players.LocalPlayer.leaderstats.WOs.Value
realScore = game.Players.LocalPlayer.leaderstats.Score.Value
KO.Value = totalko.Value - realKO
WO.Value = totalwo.Value - realWO
Score.Value = totalscore.Value - realScore
end
game.Players.LocalPlayer.leaderstats.KOs.Changed:connect(changed)
game.Players.LocalPlayer.leaderstats.WOs.Changed:connect(changed)


Absolutely no output. I know it might be a little inefficient...
Report Abuse
QwertygiyII is not online. QwertygiyII
Joined: 28 May 2010
Total Posts: 1271
08 Sep 2011 03:32 PM
1: Are you using a LocalScript?
2: I've never heard of such a thing as CurrentValue or CurrentKO or CurrentWo, so unless you defined them earlier in the script...
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
08 Sep 2011 03:34 PM
First off:
Yes I'm using a Local Script
Second, CurrentKo, CurrentValue, etc. are values in the player.
Report Abuse
QwertygiyII is not online. QwertygiyII
Joined: 28 May 2010
Total Posts: 1271
08 Sep 2011 03:35 PM
I think it might have something to do with the repeat line then.

This is a bit less "neat" but it always works for me:

while true do
wait()
if game.Players.LocalPlayer:FindFirstChild("leaderstats") ~= nil then break end
end
Report Abuse
bikerking200 is not online. bikerking200
Joined: 11 Mar 2010
Total Posts: 5047
08 Sep 2011 03:36 PM
City try this,
repeat wait() until game.Players.LocalPlayer:FindFirstChild("leaderstats")
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
08 Sep 2011 03:38 PM
Let's try, but I don't see any difference it could make..
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
08 Sep 2011 03:41 PM
Nope
Report Abuse
GoldenUrg is not online. GoldenUrg
Joined: 23 Aug 2009
Total Posts: 6428
08 Sep 2011 03:56 PM
In a localscript you can find the output in one of the log files.
http://wiki.roblox.com/index.php/Debugging#Log_Files
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
08 Sep 2011 04:05 PM
Still no output :(
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
08 Sep 2011 06:04 PM
Bawmp
Report Abuse
bikerking200 is not online. bikerking200
Joined: 11 Mar 2010
Total Posts: 5047
08 Sep 2011 06:13 PM
Bawb
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
08 Sep 2011 06:45 PM
... HElp me!
Report Abuse
GoldenUrg is not online. GoldenUrg
Joined: 23 Aug 2009
Total Posts: 6428
08 Sep 2011 06:51 PM
Are you getting the Changed events?
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
08 Sep 2011 08:30 PM
The leaderstats are changing yes, but they won't change the CurrentValue stats...
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
09 Sep 2011 02:06 PM
Bawmp
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
09 Sep 2011 03:03 PM
Come on
Report Abuse
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
09 Sep 2011 03:15 PM
What doesn't it do? And what do you want it to do? I have read it but found no errors, maybe just some loading problems.

[If I owned a school, it would be closed by now.]
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
09 Sep 2011 03:19 PM
Can't be loading problems can it? It doesn't change the values...
Report Abuse
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
09 Sep 2011 03:22 PM
KO.Value = totalko.Value - realKO
WO.Value = totalwo.Value - realWO

It will always be zero.

[If I owned a school, it would be closed by now.]
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
09 Sep 2011 03:24 PM
Why??
Report Abuse
RATEXmegaGAMER is not online. RATEXmegaGAMER
Joined: 10 Dec 2010
Total Posts: 4046
09 Sep 2011 03:32 PM
Because realKO and realWO or whatever they are, are set to totalko's and totalwo's values. Therefore taking them away from totalko's and totalwo's value will result in 0.

[If I owned a school, it would be closed by now.]
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
09 Sep 2011 03:38 PM
But they change...
TotalKo, don't change since I set their value before the function. The RealKo change because I set their value after the function.

It could be the other way around.
Report Abuse
GoldenUrg is not online. GoldenUrg
Joined: 23 Aug 2009
Total Posts: 6428
09 Sep 2011 04:06 PM
He's right, if you want to save the value of KOs you need to use value.

repeat wait() until game.Players.LocalPlayer:FindFirstChild("leaderstats") ~= nil
totalko = game.Players.LocalPlayer.leaderstats.KOs.Value
totalwo = game.Players.LocalPlayer.leaderstats.KOs.Value
totalscore = game.Players.LocalPlayer.leaderstats.Score.Value
function changed()
KO = game.Players.LocalPlayer.CurrentValue.CurrentKO
WO = game.Players.LocalPlayer.CurrentValue.CurrentWO
Score = game.Players.LocalPlayer.CurrentValue.CurrentScore
realKO = game.Players.LocalPlayer.leaderstats.KOs.Value
realWO = game.Players.LocalPlayer.leaderstats.WOs.Value
realScore = game.Players.LocalPlayer.leaderstats.Score.Value
KO.Value = totalko - realKO
WO.Value = totalwo - realWO
Score.Value = totalscore - realScore
end
game.Players.LocalPlayer.leaderstats.KOs.Changed:connect(changed)
game.Players.LocalPlayer.leaderstats.WOs.Changed:connect(changed)
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
09 Sep 2011 04:08 PM
You cannot tag values :P
Report Abuse
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
09 Sep 2011 04:32 PM
Bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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