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

My text script isnt working and nothing is showing in Output. Can I get some help please?

When I click the button nothing shows up in Output but it doesnt make the text "hi" (btw i just used "hi" for an example xd) Script:

script.Parent.MouseButton1Down:connect(function() local a = game.Workspace.PopUpOrder game.Workspace.PopUpOrder.Frame.Order.Text = "hi" wait(2) a.Parent = game.StarterGui script.Parent.Text = "Sent!" wait(3) script.Parent.Text = "Order" end)

Anybody know whats wrong?

1 answer

✓ Accepted answer

You're using StarterGui to change it, that's why. StarterGui is meant to clone GUI to every player that joins or respawns, but it's not meant to constantly update the player's GUI.

Here's a fixed version of it :

script.Parent.MouseButton1Down:connect(function() 
	for i,v in pairs(game.Players:GetPlayers()) do
		v.PlayerGui.PopUpOrder.Frame.Order.Text = "hi"
	end
	script.Parent.Text = "Sent!" 
	wait(3) 
	script.Parent.Text = "Order" 
end)

10 comments

0

So.. how do I fix it?

0

Do you want that PopUpOrder to show up for every player in the server? I'm a little confused with your code.

0

Yes.

0

Wait. Is the PopUpOrder a GUI? If it is, I don't think Workspace is the right place to put it, unless it's on a part or something.

0

Well.. you said it wont change if I keep it in startergui so what i did was I made it so it stays in workspace but after the text is changed it moves back to startergui but its invisible and visible is checked.

0

No no no. That's not what I mean. You have to PUT the GUI in StarterGui, but you don't CHANGE it in StarterGui. You'd have change the GUI in something called "PlayerGui". Here, I have the fixed script in my answer.

0

Thanks!

0

May I ask, where did you learn to script so good?

0

The Roblox wiki and Youtube. I recommend you use Youtube for basic things and the wiki for more complex things. Youtube wasn't helpful to me when it comes to something complex. :I

0

Thanks!

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