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

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

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

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.

0
Didn't help, but I don't have enough rep to thumb you down, so I'll just post this. iRzPWNzr 20 — 10y
0
;( arjun9022 34 — 10y
Ad

Answer this question