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: Works when I test it, but not online

Previous Thread :: Next Thread 
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
24 Aug 2012 10:50 PM
KnightmareXD has been my guinea pig with this and seen several failures. It works flawlessly when I test it, but doesn't work in game.

It says that PlayerGui isn't a valid member of Player

...
Yes it is.

So I added a repeat loop so it would hopefully find the PlayerGui. But it just gets stuck in the loop and never finds it. I've never renamed or moved PlayerGui.

This is only a small part of the script and everything is already defined.

local OtherPlayer = game.Players:FindFirstChild(recipient)
print(OtherPlayer.Name)
wait(.5)
repeat wait() until OtherPlayer:FindFirstChild("PlayerGui") --It gets stuck in this loop

local Message = OtherPlayer.PlayerGui.Screen.Request ------Error is here

--Nothing below ever runs.
print(Message)
Message.SenderName.Text = sender.Name
Message.Position = UDim2.new(-.25, 0, .375, 0)
Message.Visible = true
Message:TweenPosition(UDim2.new(.375, 0, .375, 0), "Out", "Linear", .5)
Player.PlayerGui.Screen.BlackOut.Visible = true
OtherPlayer.PlayerGui.Screen.BlackOut.Visible = true
Player.PlayerGui.Screen.Wait.Visible = true

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
24 Aug 2012 10:52 PM
Haha, several, if only that little. :E

¤¤ †KMXD† ¤¤ [SHG Tier~3]
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
24 Aug 2012 10:53 PM
try making it a localscript and then view the output logs in your roblox folder.

¬ SHG Scripter Tier-2, LuaLearners Elite - pm me!
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
24 Aug 2012 10:53 PM
It is in a LocalScript.

¤¤ †KMXD† ¤¤ [SHG Tier~3]
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
24 Aug 2012 10:54 PM
well in that case you should look at the logs in your appdata/local/roblox folder

¬ SHG Scripter Tier-2, LuaLearners Elite - pm me!
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
24 Aug 2012 10:54 PM
wait a minute.................

wow..............

i'm so dumb..........

¬ SHG Scripter Tier-2, LuaLearners Elite - pm me!
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
24 Aug 2012 10:59 PM
This hasn't been working for two days and I'm completely stumped. I've had my dad (who's a Com Sci major) help me for the past couple hours an he's given up.

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
24 Aug 2012 11:02 PM
dang :o

i wish my dad was a comp sci major lol. my dad is 'literally illiterate' when it comes to technology D:

i don't see any errors :\ tough luck. a last resort imo would be the scripters forum

¬ SHG Scripter Tier-2, LuaLearners Elite - pm me!
Report Abuse
Dinizterz is not online. Dinizterz
Joined: 08 Oct 2008
Total Posts: 4193
24 Aug 2012 11:05 PM
I found out that scripts dont run if its parent is a "Player". just thought maybe that could be it, it was a problem with my script too
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
24 Aug 2012 11:08 PM
@Din
It's in a ScreenGui within PlayerGui

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
24 Aug 2012 11:09 PM
I've been having the same problem with my game! When a player walks over the guard trap I clone a Localscript into the character for camera effects and other server-client communication but the Localscript just randomly stops working out of nowhere, it doesn't even error >.<

Also for your actual code try this -

table.foreach(OtherPlayer:GetChildren(), print)

Tell me what you get
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
24 Aug 2012 11:13 PM
Oh wait by online you men real online not Start Server? hehe nvm
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
24 Aug 2012 11:16 PM
@smurf
Yes, when I test it I use Start Server, and online is when I pull KnightmareXD into my game and attempt to play it.

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
24 Aug 2012 11:17 PM
Does it work in Start Server then? and if you did add that line I posted. any output?
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
24 Aug 2012 11:19 PM
It works perfectly in Start Server. And I haven't tried your idea yet, but I just thought of something...

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
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