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

I'm on the right team, but spawning on the wrong spawn?

Hi,

I have 2 teams, SFU (a group, TeamColor "Bright green") and Otherwise (anything else, TeamColor "White").

I have a script in the SFU spawn, which is this:

group = 825311
deb = true
function Check(p)
if p ~= nil then 
deb = false 
local human = p.Parent
if human ~= nil then
local player = game.Players:GetPlayerFromCharacter(human)
if player ~= nil then
end

if player:IsInGroup(group) then
print("Yep!")
player.TeamColor = BrickColor.new("Bright green")
else
print ("Nope!")
end
end
end
end

script.Parent.Touched:connect(Check)

The scoreboard says I'm on the "Otherwise" team, but I spawn at the SFU spawn, and I checked the output, and it said

Nope!

Nope! (Yes it did it twice)

What is going wrong?

1 answer

You need to have a indicator in the script, that let's the script no that a certain player is in this group. I don't know a lot about scripting but you need some sort of indicator. If this did not help, please don't give me thumbs down.

2 comments

0

Didn't help, but I don't have enough rep to thumb you down, so I'll just post this.

0

;(

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