I have a script here that relies on the CharacterAdded function to make a gui appear whenever the character respawns so they can choose their spawn point, but I don't want it to run when they first join the game, only every respawn after. Here is the code. How do I edit this to make it so that it doesn't run when they first join? EDIT: It appears this function doesn't even work by itself. What am I doing wrong?
function CharacterAdded(player)
script.Parent.Parent.Visible = true
function Click(mouse)
if game.Workspace.ERDSObj.Marker.Color == player.TeamColor then
player.Character.Torso.CFrame = CFrame.new(Vector3.new())
script.Parent.Parent.Visible = false
end
end
end
script.Parent.MouseButton1Down:connect(Click)

4 comments
I think you used a local script too so this should work (:
While I'm certain this should work, it strangely isn't...
I did something like this before, but no matter what I do, this gui won't show up. This is what I needed. I'll need a new question for the gui showing.
That is very strange.... If this doesn't work then you might just want to connect the function with a died even or something. Good luck to you though!