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

GUI works in Studio and another game but not in a the game I want it to?

Hello, I am not a very good scripter, in fact, I do not know how to script really at all, so help is very much appreicated. My problem is, I have a group team change gui that I got from free models, and it works in my "training base" but not in my "capital".It works in studio, however. I then thought it was a problem with the model. I edited the script so it should work, but again, it worked in Studio, but not ingame. Here are the scripts.

function Click(mouse) 
if script.Parent.Parent.Parent.Parent.Parent:IsInGroup(3363046) then 
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Crimson") 
end 
end 

script.Parent.MouseButton1Click:connect(Click) 

and here is the script for the visitors.

function Click(mouse)
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Medium stone grey")
end


script.Parent.MouseButton1Down:connect(Click)

I am aware of the waitforchild function but the problem is is that I have no idea where to put it or what to put in the parantheses. Thanks, and help is much appreciated.

3 comments

0

Do your scripts produce any output?

0
0

How do I check that?

1 answer

lol too many parents to even know what's going on... Here, I rescripted it for you to do what I think you want it to do:

script.Parent.MouseButton1Click:Connect(function()
	if game.Players.LocalPlayer:IsInGroup(3363046)then
		game.Players.LocalPlayer.TeamColor=BrickColor.new'Crimson'
	else
		game.Players.LocalPlayer.TeamColor=BrickColor.new'Medium stone grey'
	end
end)

3 comments

0

Still doesnt work. When I click on the GUI, it doesn't do anything at all

0

Try using BrickColor.new("Crimson") and BrickColor.new("Medium stone grey").

0

Are you using a Local Script? Because Server Scripts doesn't work with Gui's. It works for me so it must work for you too, unless you're using FilteringEnabled, which I doubt because you said you don't know how to script.

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