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

Gui wont work in roblox player but will work in studio and i cant find out why?!

I have a gui script but when i use it in studio is fine but in the player it wont work

local frame = script.Parent.Parent.Frame
local toggle = false
script.Parent.MouseButton1Click:connect(function()
	if toggle == false then
frame:TweenPosition(UDim2.new(0.37, 0.04, 0.001, 0), "Out", "Back", 3)
       script.Parent.Text = "<"
       toggle = true
       else
   frame:TweenPosition(UDim2.new(-0.002, -200, 0.001, 3), "In", "Back", 3)
       toggle = false
       script.Parent.Text = "<"
   end
end)


3 comments

0

I do not like using script.Parent method for GUI's. I always use PlayerGui and I never had problems with it.

1

Is this a local script or server script? Is Filtering Enabled on?

0

Go in game and check for errors in the developer console (Press F9). If there are any errors, edit them into your question.

1 answer

Weird, same happened to me and at least 20 guys more, it is all working correctly, what I will recommend.

For experimented developers: check if there's another script interfering with the work of this one What I did: submit everything on models to Roblox and create a new game adding everything again, I won't recommend to do that if your game was hard to do or is fully released, because it will delete all visits and and all that stuff (this solution worked to me)

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