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

What is the problem with this?

What's the problem with this script?

function script(player)
if Game.Players.PlayerAdded.Name == "Player1" then -- Player1 is for testing
s = Instance.new ("Message")
s.Parent = Game.Workspace
s.Text = "The owner has joined!"



end
end

2 answers

This should work

game.Players.PlayerAdded:connect(function(player)
	if player.Name == "Player1" then
		s = Instance.new("Message")
		s.Name = "asd"
		s.Parent = Game.Workspace
		s.Text = "The owner has joined"
		wait (3)
		game.Workspace.asd:Destroy()
		
	end
end)

i added

wait (3)
game.Workspace.asd:Destroy()

or else the message will stay there forever

I'm not too sure, but aren't

function
if
then

all functions, so wouldn't you need 3 ends instead of two? Sorry if this doesn't help, new to scripting, trying to help.

end
end
end

2 comments

1

Myst, then goes with if

0

Oh sorry, then, apologies

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