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

Respawn Character GUI on Click Fix?

For this GUI i want it to respawn your character on the right spawn.. What i mean by the right spawn is... [If your on Blue Team you spawn on Blue Team spawn] [If your on Red Team you spawn on Red Team spawn] im currently stuck on this script i dont know how i would code for the right spawn

local Button = script.Parent
local Hold = nil

Button.MouseButton1Down:connect(function()
	if (Hold ~= nil) then return end
	Hold = true
wait(1)
Button.Text = "5"
wait(1)
Button.Text = "4"
wait(1)
Button.Text = "3"
wait(1)
Button.Text = "2"
wait(1)
Button.Text = "1"
wait(1)
Button.Text = "0"
wait(1)

	Button.Parent.Parent.Parent:LoadCharacter(true)

	Hold = nil
end)

1 answer

It sound's like the SpawnLocation's you are trying to use has Neutral(SpawnLocation Property) set to true, which basically means anyone can spawn on it regardless of TeamColor. You also want to make sure the TeamColor is correct. Even though you didn't ask for a neater script, if you want you can replace the 5 Button.Text = to the following script:

for i = 1,5 do
	Button.Text = 5 - i
	wait(1)
end

Wiki explains more on the Neutral property.

If you need anymore help on SpawnLocation's: ROBLOX Wiki on SpawnLocations

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