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

I have a SpawnLocation bug...?

Asked by 9 years ago

I have a TeamChange GUI at my fort, and it works mostly as intended. However, whenever the player respawns, they ONLY spawn at the Raider's spawn, which is the team everyone starts at on joining a server.

local ScreenGui         = script.Parent
local CoastalCombat     = ScreenGui.CoastalCombat
local Neutral           = ScreenGui.Neutral
local Raiders           = ScreenGui.Raiders
local player            = ScreenGui.Parent.Parent
local character         = player.Character

CoastalCombat.MouseButton1Down:connect(function()
    if player:IsInGroup(2546195) then
        player.TeamColor = BrickColor.new("Cool yellow")
        character.Humanoid.Health = 0
    end
end)

Neutral.MouseButton1Down:connect(function()
    player.TeamColor = BrickColor.new("Bright green")
    character.Humanoid.Health = 0
end)

Raiders.MouseButton1Down:connect(function()
    player.TeamColor = BrickColor.new("Bright red")
    character.Humanoid.Health = 0
end)
0
You aren't allowing enough time for the team color to change. Roblox glitch LostPast 253 — 9y
0
The teamcolor does change. It's just that players ONLY spawn at the raider's spawn. Stravellia 0 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

Spawn

The issue lies not within your script, but in the Spawn Location meant for certain teams. Spawn Locations have a TeamColor property that has to be set for certain teams to be able to spawn at that specific spawn.

At the moment, your spawn probably has the neutral property set to true. If this is so, as by the wikis denotation, "This means that any player, of any team, can spawn on it if this property is set to true."

In basic terms, anyone can spawn on a neutral spawn location.

If you do set the TeamColor property, players who are in a team associated with the same TeamColor will be able to spawn on that spawn location.


Useful Links

TeamColor Property: http://wiki.roblox.com/index.php?title=API:Class/SpawnLocation/TeamColor

Neutral Property: http://wiki.roblox.com/index.php?title=API:Class/SpawnLocation/Neutral

Spawn Location Object Page: http://wiki.roblox.com/index.php?title=API:Class/SpawnLocation

0
None of them are Neutral and they all have the correct TeamColor. Stravellia 0 — 9y
Ad

Answer this question