Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Adding and removing a gui?

Asked by
Bman8765 270 Moderation Voter
10 years ago

After my last question got answer (Which was very helpful btw) I want to know, how would I clone a ScreenGUI into starter gui and remove it from startgui when done. I need info like would it be a local or regular script and wiki links if possible. Thanks!

3 answers

Log in to vote
1
Answered by 10 years ago
Workspace.ScreenGUI:Clone().Parent=StarterGui --assuming its in Workspace after it gets cloned the
--clone is put in starter gui




function onClicked()
--stuff
--stuff
StarterGui.ScreenGUI:Remove()--gets removed at the end
end
StarterGui.ScreenGUI.MouseButton1Click:connect(onClicked)--when screengui is clicked go to function onClicked

i am not sure if its going to be local or regular but i am leaning towards regular. http://wiki.roblox.com/index.php?title=RBX.lua.LocalScript_(Object)

clone method wiki link:http://wiki.roblox.com/index.php?title=Clone_(Method)&redirect=no

0
I'll try it, thanks! Bman8765 270 — 10y
0
No problem ,just doing my job. threatboy101 2 — 10y
0
also for my script it removes the gui when you click on that gui threatboy101 2 — 10y
0
Where do I place the script, also can I have wiki links to where you got this info? Bman8765 270 — 10y
View all comments (3 more)
0
place the script in Workspace or serverscriptstorage threatboy101 2 — 10y
0
watch codeTheorem roblox game development series he got me started here is the link: https://www.youtube.com/user/bballer13snTV/playlists threatboy101 2 — 10y
0
serverscriptstorage would reduce lag if you used it threatboy101 2 — 10y
Ad
Log in to vote
0
Answered by
Adryin 120
10 years ago

Heres a example, your information was very unformational, so I did this with your information.

time = 1

i = Instance.new("ScreenGui")
i.Parent = game.ScreenGui
wait(time)
i:remove()
0
What I mean is that I have a Gui in StarterGui and I need a script that can remove it after I click a certain button on that gui Bman8765 270 — 10y
0
... Asking for something isnt right, if you know how to do it I will answer, your asking for scripts, you don't need help.. Adryin 120 — 10y
0
I was asking for wiki links -,- Bman8765 270 — 10y
0
BTW, time is a horrible variable to set as it is a built in function. l0cky2013 135 — 10y
0
Its a example... Adryin 120 — 10y
Log in to vote
0
Answered by
l0cky2013 135
10 years ago

I would do something like this

Example

local waittime=3
function giveGUI(player)
if player and player.PlayerGui then
local gui=game.ServerStorage.Gui:clone()
gui.Parent=player.PlayerGui
wait(waittime)
gui:Destroy()
end
end

Usage

giveGUI(game.Players.Player1)
0
The code is great and all guys but if you could simply give me wiki links to where you get this data that would be great so I can implement it in in my own way, also should this be a localscript and does it have to be in serverstorage if I made a different script that does this? Bman8765 270 — 10y
0
It's just application of prior knowledge, in my opinion. l0cky2013 135 — 10y

Answer this question