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: Script broken *should be easy fix*

Previous Thread :: Next Thread 
FearMeIAmLag is not online. FearMeIAmLag
Joined: 02 Jun 2012
Total Posts: 1748
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
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
17 Aug 2012 09:37 AM
Is it a local player in a gui?
Report Abuse
FearMeIAmLag is not online. FearMeIAmLag
Joined: 02 Jun 2012
Total Posts: 1748
17 Aug 2012 09:38 AM
yes...


Somebody already asked me if it was a localscript, becuase of the localplayer...
Report Abuse
orangegreenblue is not online. orangegreenblue
Joined: 04 Sep 2010
Total Posts: 10906
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
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
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
FearMeIAmLag is not online. FearMeIAmLag
Joined: 02 Jun 2012
Total Posts: 1748
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
orangegreenblue is not online. orangegreenblue
Joined: 04 Sep 2010
Total Posts: 10906
17 Aug 2012 09:43 AM
Does it say anything in the output?

-orangegreenblue, the Lua Noob
Report Abuse
FearMeIAmLag is not online. FearMeIAmLag
Joined: 02 Jun 2012
Total Posts: 1748
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
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
17 Aug 2012 09:44 AM
also take out the pcall, it doesn't help here.
Report Abuse
orangegreenblue is not online. orangegreenblue
Joined: 04 Sep 2010
Total Posts: 10906
17 Aug 2012 09:45 AM
No you didn't, that's not the output.

-orangegreenblue, the Lua Noob
Report Abuse
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
17 Aug 2012 09:46 AM
Are you testing in play solo? Dont.
Report Abuse
FearMeIAmLag is not online. FearMeIAmLag
Joined: 02 Jun 2012
Total Posts: 1748
17 Aug 2012 09:46 AM
that is what the output gave me...
Report Abuse
FearMeIAmLag is not online. FearMeIAmLag
Joined: 02 Jun 2012
Total Posts: 1748
17 Aug 2012 09:48 AM
@2above, oh, i will try it in play mode to see...
Report Abuse
orangegreenblue is not online. orangegreenblue
Joined: 04 Sep 2010
Total Posts: 10906
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
FearMeIAmLag is not online. FearMeIAmLag
Joined: 02 Jun 2012
Total Posts: 1748
17 Aug 2012 09:51 AM
it doesn't work in play mode either...
Report Abuse
FearMeIAmLag is not online. FearMeIAmLag
Joined: 02 Jun 2012
Total Posts: 1748
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
WhoBloxedWho is online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
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
FearMeIAmLag is not online. FearMeIAmLag
Joined: 02 Jun 2012
Total Posts: 1748
17 Aug 2012 10:50 AM
should, but it didn't... :(


too bad though, it seemed good...
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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
FearMeIAmLag is not online. FearMeIAmLag
Joined: 02 Jun 2012
Total Posts: 1748
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
FearMeIAmLag is not online. FearMeIAmLag
Joined: 02 Jun 2012
Total Posts: 1748
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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
17 Aug 2012 11:17 AM
ur welcome

† KMXD †
Report Abuse
FearMeIAmLag is not online. FearMeIAmLag
Joined: 02 Jun 2012
Total Posts: 1748
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
FearMeIAmLag is not online. FearMeIAmLag
Joined: 02 Jun 2012
Total Posts: 1748
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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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
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