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

waiting script not working?

function welcome()
	wait(1)
	script.Parent.Visible = True
	end
game.Players.PlayerAdded:connect(welcome)

this script is so that when a player joins the game it will wait one second before showing the GUI that says welcome, for some reason it does not work. also for some reason i dont have my decals in my toolbox are, the drop down thing only goes as far as deadly machines

2 answers

game.Players.PlayerAdded:connect(function(player)
	function onClick()
			wait(1)
			player.PlayerGUI.GUI.Visible = true
	end
end)
player.PlayerGUI.GUI.MouseButton1Click:connect(onClick)

The PlayerAdded event is run when a player joins a game, the (player) will find the persons name who has joined, it will then wait for the player to click the TextButton before waiting one second before using the name it found earlier to search through the PlayerGUI and finding the right GUI and making it visible.

Apologies for the bad answer earlier, I was tired.

4 comments

0

this doesnt work

0

You must change the .GUI. to the name of your GUI and/or it's children.

0

did you mean "Players" instead of player

0

i dont get this script over all, can you explain it to me and also explain why mine did not work

function welcome()
    wait(1)
    script.Parent.Visible = true -- you put 'True' with a capped 'T'. It can't be like that.
    end
game.Players.PlayerAdded:connect(welcome)

This should fix it for you. Just make sure you put this script in the frame of the 'welcome gui' that you have.

Edit: this is what I like to do, i don't like to do the top one.. :/

game.Players.PlayerAdded:connect(Function welcome()
	wait(1)
	script.Parent.Visible = true
end)

7 comments

0

ok

0

Tell me if it works now. :D

0

it still doesnt work, i dont get it.. the script is a child of the text label, and then i make the visiblity true, but it still stays false when i test it,

0

Here, Try the one that i just edited. It's the 2nd one.

0

i dont think that one worked either, i seriously dont get the problem, go on your roblox studio to see if the script works for you, maybe its because where i placed the script and what i named the labels, im still a beginner lol

0

Here, make it a model and have it free, then pm me on roblox the link of the model. I will make it work and put it as a free model and it will work then.

0

just make a text button and put the script in and see if it works,

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