Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Custom GUI Responsive when tested in studio, but not in an actual server?

Hey guys! First off, thanks for taking the time to view my question. As for my problem: I created a custom chat gui (just for the hell of it), and it's working great when I click "test" in the studio. The problem I'm encountering is that when I enter my game via Roblox (not studio) the gui is almost completely unresponsive.

I won't post the entire source code, as it's way too long for that, so here's the part where I copy it to the new player:

game.Players.PlayerAdded:connect(function(plr) 
	script.ChatGui:Clone().Parent = plr.PlayerGui  
end)

Here's the link to my place where I'm currently hosting the gui:http://www.roblox.com/games/336727197/Model-Creation-Center

If you can think of anything that I could add to help you help me, please tell me!

Note: I previously said almost completely unresponsive, because I can click one button and it will briefly change color, and because I can still click inside of the textbox used to chat. Other than that nothing else will respond or change.

Tried Solutions:

  1. Add a wait()
  2. changed script.ChatGui to script:WaitForChild("ChatGui")

3 comments

0

Make sure every single part of your GUI exists before doing anything else, you get and error when you join that place involving a problem than can be fixed with what I said, unless it actually doesn't exist. However, you're not giving enough information to get help.

0

If filtering enabled is on than server scripts can't access the players GUI. You will have to use remote function. :P

3 answers

why not wait for the character also?

unless u want it to run once

wait()
game.Players.PlayerAdded:connect(function(plr)
 script.ChatGui:Clone().Parent = plr.PlayerGui  
end)

Try this^

11 comments

0

I thought the character wouldn't matter, because I'm adding it to the player's gui. Am I wrong?

0

I tried your suggestion, nothing changed D:

0

Did u want the Gui to copy everytime the player spawns?

0

Try using localscript Make sure the chatGui exists and check for errors

0

Sorry for my ignorance, but why would it copy every time they spawn? I thought the PlayerAdded event only happened when they joined the game?

0

it does run on enter, i thought u wanted it to run on respawn

0

Oh ok. As for your comment on using a local script and making sure ChatGui isn't nil, I just added a :WaitForChild("ChatGui") to make certain and it isn't nil. Also I'm using a local script for most of it's functionality, but this part that I've posted is in a regular script.

0

try putting prints in everyline and test were it stops

0

That's part of my problem: it works in the studio, but not in an actual server :/ (prints won't prove anything)

0

GUI has no need to wait for the Character, wait() before game.Players.PlayerAdded..... is usless

0

I'll second that. You actually need to wait for the PlayerGui, and the wait() before the connection line is redundant and actually code-breaking.

You can try replacing this...

script.ChatGui:Clone().Parent = plr.PlayerGui 

to

script:WaitForChild("ChatGui"):Clone().Parent = plr.PlayerGui 

I remember someone helping me with this similar problem.. They told me to add a waitforchild on one part of the script. This might help or wont help. But im just trying my best :)

1 comment

0

Thanks for your effort! I tried your solution, but alas to no avail :(

You should try, going into the in- game and pressing F9 to access the 'console' which helps you identify the LOCATION and the PROBLEM in your script.

Also make sure you put that on a proper type of script paper, e.g: LocalScript,Script,ModuleScript

This discussion is preserved as it was. New answers, comments, and votes are closed.