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

I Want To Update My Gui Using A Require How Do I Do That?

I Want A Script To Update (Or Run The Require Again) My Gui Using A Require But Before The Gui Updates I Made Another Gui That Says There Is A Update To The Gui And They Should Press The Update Button To Update The Gui. I Tried A Few SCript But Non Of Them Worked Here Is My Code:

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Parent.Parent:Destroy()
	require(3882147708)
end)

It Also Destroy's The Original Gui But Still Runs The Require(The Gui Goes Into The Starter Gui Folder Btw) And I Want The Gui To Go Back Into The Players Gui When It In The Starter Gui But I Cant Get It To Work Please Help Me Out

1 answer

✓ Accepted answer

Do this.

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent.Parent.Parent:Destroy()
if not script.Parent then
-- nothing
else
    require(3882147708)
end
end)

8 comments

0

it worked but even tho the gui is in the starter gui i dont get my gui on my scsreen you think you can help with that?

0

Hm

0

have you found a way to do it yet?

0

ah yes

0

User PlayerAdded event, store the gui in ServerStorage, and when the playeradded event is fired, clone that gui and parent it to the player's PlayerGui object.

0

do i have to make the player rejoin?

0

Use teleport Service:TeleportToPlaceInstance(), Also use game.JobId so it chooses the SAME server and not a random server

0

ok thanks

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