Hi i have a problem with my script.I was trying to make the script where i want it to make players from 4 different teams spawn with a default npc that is that different from other teams for example for team xbox i want them to have a default npc for those players that are in that team that looks different from from the other team default npc.Do i need to be more specific in this script?Did i put things i don't need in the script?I'm still a beginner at scripting and still trying to understand the language of lua in roblox and couldn't find what i was looking for on google or youtube so i gave it a try on making my own script.I really would appreciate it if you guys could help me out on this thanks.
--Variables for teams
local Team = game.Teams.Xbox
local Team = game.Teams.Playstation
local Team = game.Teams.Nintendo
local Team = game.Teams.PC
--Variables for Team spawns
local spawns = game.workspace.Nintendo.Nspawns
local spawns = game.workspace.PC.PCspawns
local spawns = game.workspace.Playstation.PSspawns
local spawns = game.workspace.Xbox.Xspawns
--Variables for TeamNpc
local TeamDefaultNPC = game.StarterPlayer.XboxNpc
local TeamDefaultNPC = game.StarterPlayer.PlaystationNpc
local TeamDefaultNPC = game.StarterPlayer.PcNPC
local TeamDefaultNPC = game.StarterPlayer.NintendoNPC
--Player Variable
local StarterPlayer = game.StarterPlayer.Humanoid
function
if local spawn = game.workspace.Pc.PCspawns then StarterPlayer = game.StarterPlayer.PcNPC end
if local spawn = game.workspace.xbox.Xspawns then StarterPlayer = game.StarterPlayer.XboxNpc end
if local spawn = game.workspace.Nintendo.Nspawns then StarterPlayer = game.StarterPlayer.NintendoNPC end
if local spawn = game.workspace.Playstation.PSspawns then StarterPlayer = game.StarterPlayer.PlaystationNpc end
end

2 comments
remove local from line 22-26 after if
hmm...i fixed my code that doesnt have errors thanks to you,but it didn't function as i expected to see,the starter player still uses a custom character instead of the default characters i made