Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 8 years ago

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")

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. alphawolvess 1784 — 8y
0
If filtering enabled is on than server scripts can't access the players GUI. You will have to use remote function. :P User#11440 120 — 8y

3 answers

Log in to vote
0
Answered by 8 years ago

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^

0
I thought the character wouldn't matter, because I'm adding it to the player's gui. Am I wrong? Jameson5011 0 — 8y
0
I tried your suggestion, nothing changed D: Jameson5011 0 — 8y
0
Did u want the Gui to copy everytime the player spawns? xlaser23 60 — 8y
0
Try using localscript Make sure the chatGui exists and check for errors xlaser23 60 — 8y
View all comments (7 more)
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? Jameson5011 0 — 8y
0
it does run on enter, i thought u wanted it to run on respawn xlaser23 60 — 8y
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. Jameson5011 0 — 8y
0
try putting prints in everyline and test were it stops xlaser23 60 — 8y
0
That's part of my problem: it works in the studio, but not in an actual server :/ (prints won't prove anything) Jameson5011 0 — 8y
0
GUI has no need to wait for the Character, wait() before game.Players.PlayerAdded..... is usless alphawolvess 1784 — 8y
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. PlsNoDiscrimination 0 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

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 :)

0
Thanks for your effort! I tried your solution, but alas to no avail :( Jameson5011 0 — 8y
Log in to vote
0
Answered by 8 years ago

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

Answer this question