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

Script works, but GUI show up after being enabled? Using new roblox dialogue edior.

I'm using Roblox's new dialogue editor, and you can make functions when a player clicks a response, which I've done. However, the code I'm using is working fine, because it goes to the position I want it to, it's just not showing up at all. I can't see it.

return function(player, dialogueFolder)
local Gui = game.StarterGui.GUI	
	Gui.Enabled = true
	Gui.Frame:TweenPosition(UDim2.new(0.5, -200, 0.5, -250), 'Out',  'Sine', 1)
end

(First post on this website FYI.)

2 comments

0

Are you actually calling the function? (Considering it''s returned, so I'm assuming it's coming from either a ModuleScript or it's inside another function)

1

Each player has a GUI folder called the PlayerGui. That is what they see. The StarterGui is what you see in Studio, and what is replicated (copied) to all players in the server upon joining or respawning, so you would change it in the PlayerGui. If this is a LocalScript, use script.Parent.Parent etc..

1 answer

✓ Accepted answer

here is the fix for your script :

return function(player, dialogueFolder)
local Gui = game.Players.LocalPlayer.PlayerGui.GUI --Make sure it's local script
    Gui.Enabled = true
    Gui.Frame:TweenPosition(UDim2.new(0.5, -200, 0.5, -250), 'Out',  'Sine', 1)
end

##You should know more about gui :

We create gui in StarterGui But after a player joins The Childs of StarterGui be cloned to game.Players.LocalPlayer.PlayerGui Every Player see that gui that's inside that player's gui, That's what make us able to build deferent gui for every player.

2 comments

0

Thanks, I'm not sure if it will work as I don't know if the editor uses local script for the functions..

0

I told to use local script because only local script has thevalue of LocalPlayer, if you can't make it in a local script then in line to you will have to type player's name in the place of LocalPlayer, So local script would be better.

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