I have been working on a script for this war group I am creating a fort for. They requested a script that will create a team pick option at the Start of the game. Everything was going fine until I added this part of the script.

game.Players.PlayerAdded:connect(function(plr)
	
	local stats = Instance.new("IntValue",plr)	
		stats.Name = 'leaderstats'
	
	local career = Instance.new("StringValue",stats)
		career.Name = 'Career'
			career.Value = 'Raiders'
			
			local career = Instance.new("StringValue",stats)
		career.Name = 'Career'
			career.Value = 'Allies'
			
			if not then career = Instance.new("StringValue",stats)
		career.Name = 'Career'
			career.Value = 'Immigrant'
			wait (0)
			
	
end)

This has not worked as this is my 3rd time rescripting it and it is still not working. Anyone have any tips for this script?

3 comments

2

if not then is invalid syntax

2

Other tips: Indent properly; Don't wait(0);

0

use if Object == nill then Rest of code