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

Why won't this team Camera script work?

game.Players.PlayerAdded:connect(function(p)
--p is the player lold
if p.TeamColor==game.Teams['Lobby'].TeamColor then
	
	
game.StarterPlayer.CameraMaxZoomDistance=15--Original was 400
game.StarterPlayer.CameraMinZoomDistance=0.5--Make this a Script!

-- or this way

game.StarterPlayer.CameraMode="Camera"

--Lobby stuff here
p.Changed:connect(function(val)
if val=='Character' then
if p.Character==nil then repeat wait() until p.Character~=nil end
--This is for when they die...

end
end)
elseif p.TeamColor==game.Teams['Bright green'].TeamColor then
	
game.StarterPlayer.CameraMaxZoomDistance=0.5--Original was 400
game.StarterPlayer.CameraMinZoomDistance=0.5--Make this a Script!

-- or this way

game.StarterPlayer.CameraMode="LockFirstPerson"
--Non-lobby stuff here

p.Changed:connect(function(val)
if val=='Character' then
if p.Character==nil then repeat wait() until p.Character~=nil end
--This is for when they die...
end
end)
end
end)

For whatever reason it works for the Lobby team but for the Green team it uses the settings from the lobby team.

6 comments

0

try having them in separate Scripts.

0

Still does the same thing

0

instead of using Elseif try, Else (have the other teams FPS settings): Use an else

0

Else just creates more errors

0

Are you sure the teams actually have different colors?

0

Yes

1 answer

Do you see this in the script?

-- or this way

I think you have to delete the code underneath

-- or this way

I don't know though, I haven't fooled around with the Camera part of Roblox Lua.

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