|
| 17 Aug 2012 09:34 AM |
The script is supposed to make the gui have text in which reads, "Deaths: *" the * is supposed to be the number of deaths...
while wait() do pcall(function() script.Parent.Text = "Deaths: " .. game.Players.LocalPlayer.leaderstats.deaths.Value end) end
If need be, the output is:
> while wait() do > pcall(function() script.Parent.Text = "Deaths: " .. game.Players.LocalPlayer.leaderstats.deaths.Value end) > end
Advice given before to me was:
try adding an if to see the problem: if pcall(...your code...) then else print('problem!') end
Also, the text box in which the script is located, is called TXPbox, just in case if anybody needs that to fix it... |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 09:37 AM |
| Is it a local player in a gui? |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 09:38 AM |
yes...
Somebody already asked me if it was a localscript, becuase of the localplayer... |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 09:40 AM |
You should really used the Changed event for things like that to reduce lag.
-orangegreenblue, the Lua Noob |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 09:40 AM |
| "Is a local player in gui?" I have no Idea what I said there, I ment to ask If the script is a local script and its placed in a gui? |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 09:42 AM |
yes it is, i said that somebody already asked me that...
it is placed within a textboxm which is inside of a frame, inside of a screengui, inside of the startergui |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 09:43 AM |
Does it say anything in the output?
-orangegreenblue, the Lua Noob |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 09:44 AM |
I posted the output...
*EVERYONE, READ THE WHOLE POST, SO THAT WAY YOU DON'T HAVE TO ASK ME ALL THESE QUESTIONS WHICH ARE ALREADY ANSWERED* |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 09:44 AM |
| also take out the pcall, it doesn't help here. |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 09:45 AM |
No you didn't, that's not the output.
-orangegreenblue, the Lua Noob |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 09:46 AM |
| Are you testing in play solo? Dont. |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 09:46 AM |
| that is what the output gave me... |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 09:48 AM |
| @2above, oh, i will try it in play mode to see... |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 09:48 AM |
No, it really didn't.
It looks like you copy pasted the script.
-orangegreenblue, the Lua Noob |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 09:51 AM |
| it doesn't work in play mode either... |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 10:00 AM |
| I need some better help, like, remove... add... or somebody to fix the script and post it |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 10:04 AM |
repeat wait(0) until game.Players.LocalPlayer:FindFirstChild("deaths",true) local Player = game.Players.LocalPlayer local Stat = Player:FindFirstChild("deaths",true)
while wait(0) do script.Parent.Text = "Deaths: " ..Stat.Value end
It should work, no need for pcall. |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 10:50 AM |
should, but it didn't... :(
too bad though, it seemed good... |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 10:56 AM |
I already told you before, it should work, I even tested it. There's probably some other logical error.
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 10:59 AM |
idk why... i will try removing the text button, and making a new one and inserting the script there...
it might work, or it might be because i have a leaderboard remover which breaks the leaderboard... |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 11:17 AM |
I think i may have found out why it doesn't work, i believe that the leaderboard script doesn't work... :P
*This part was written a few minutes later*
That was such a fail, the only reason it didn't work was because the leaderboard was corrupted :P
it works now, thanks for your help everyone! |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Aug 2012 11:56 AM |
| I used the one that the guy posted recently, and when i die, it does not change the text to 1, it stays at zero... The textbutton doesn't have the text at 0, so the script somewhat works, going to check it out in play mode later, and also see if there is a problem with the leaderboard... |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 02:10 PM |
I tried in play mode, the script makes the number 0 appear, but if you die, it does not change it...
Can somebody please tell me if it is just the leaderboard, or the script...
Also, just so that everyone knows, i am using the script that the one guy posted...(5 or so replies above this) |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2012 02:12 PM |
Probably the leaderboard, post it. The part where it adds the deaths most likely doesn't work.
† KMXD † |
|
|
| Report Abuse |
|
|