Aw man, you were so close. The reason nothing happens if you are a human is because you need an end after the third if statement. Your code should look like this.
01 | function module:SpawnCharacter(plr,char,data) |
02 | local D = math.random( 1 , 2 ) |
03 | local S = math.random( 1 , 6 ) |
04 | print ( "D and S Active!" ) |
05 | local HRP = char:FindFirstChild( "HumanoidRootPart" ) |
06 | if data.Race.Value = = "Demon" then |
08 | local NewCFrame 1 = game.Workspace.Spawns.DemonSpawn 1. CFrame |
09 | HRP.CFrame = NewCFrame 1 |
12 | local NewCFrame 2 = game.Workspace.Spawns.DemonSpawn 2. CFrame |
13 | HRP.CFrame = NewCFrame 2 |
18 | local NewCFrame 3 = game.Workspace.Spawns.SlayerSpawn 1. CFrame |
19 | HRP.CFrame = NewCFrame 3 |
22 | local NewCFrame 4 = game.Workspace.Spawns.SlayerSpawn 2. CFrame |
23 | HRP.CFrame = NewCFrame 4 |
26 | local NewCFrame 5 = game.Workspace.Spawns.SlayerSpawn 3. CFrame |
27 | HRP.CFrame = NewCFrame 5 |
30 | local NewCFrame 6 = game.Workspace.Spawns.SlayerSpawn 4. CFrame |
31 | HRP.CFrame = NewCFrame 6 |
34 | local NewCFrame 7 = game.Workspace.Spawns.SlayerSpawn 5. CFrame |
35 | HRP.CFrame = NewCFrame 7 |
38 | local NewCFrame 8 = game.Workspace.Spawns.SlayerSpawn 6. CFrame |
39 | HRP.CFrame = NewCFrame 8 |
The reasoning is that the "else" statement that should be for the first if statement was actually for the third, the false indentation probably threw you off. Good luck with your game.