I'm making a murder game and I have an error. 'Argument 1 Missing Or Nil' The error part is at the part where it teleports them to the map. I am an experienced Roblox scripter but I have never seen this error. If any of you know this error or know a fix please reply below with the fix. Hope you can help me with this!
Script:
01 | local knife = game.ServerStorage:WaitForChild( 'Knife' ) |
02 | local gun = game.ServerStorage:WaitForChild( 'Revolver' ) |
03 | local status = game.ServerStorage:WaitForChild( 'Status' ).Value |
04 | local plrsneeded = 1 |
05 | local stopgame = false |
06 | local gameon = false |
07 | local mapnames = { 'Combat League By Parasc' } |
08 | local putmapsinworkspace = false |
09 | local Maps = game.ServerStorage:WaitForChild( 'Maps' ) |
10 | local MapFolder = game.Workspace:WaitForChild( 'Map' ) |
11 | local MapFound = false |
12 | local player 1 = nil |
13 | local player 2 = nil |
14 | local player 3 = nil |
15 | local player 4 = nil |
Thank you for reading, ChrisThrRoblox1234 (Chris) P.S. I would like this to be fixed quickly if possible!
1 | if putmapsinworkspace = = true then |
2 | local map = Maps:FindFirstChild(mapnamethatwaspicked) |
3 | map.Parent = MapFolder |
4 | elseif game.Workspace:FindFirstChild(mapnamethatwaspicked) or MapFolder:FindFirstChild(mapnamethatwaspicked) then |
5 | MapFound = true |
6 |
7 | -- This would not work, because you have never sat putmapsinworkspace to = true, its always false... |
1 | end |
Just to let you all know the error is at line 71 to line 73. The error is 'Argument 1 Missing Or Nil'. Those lines are the ones that are meant to teleport the player to some bricks in the map named: 'Spawnpoint1', 'Spawnpoint2', 'Spawnpoint3' and 'Spawnpoint4'. Also, some people are saying: 'This would not work, because you have never sat putmapsinworkspace to = true, its always false...'. It is false due to that there is only one map and there is no point in putting it in MapsFolder over and over again, it's pointless! So it is already in the folder - That's why its putmapsinworkspace = false! Now let me get to the last point, people are also saying that the players variable = nil! Its set to nil because it will set it to the players name when the round starts. (As seen on line 56 - 69). Also for some reason, the status is not changing (value and text)? Script in status text gui:
1 | script.Parent.Text = game.ServerStorage.Status.Value |
2 |
3 | game.ServerStorage.Status.Changed:Connect( function () |
4 | script.Parent.Text = game.ServerStorage.Status.Value |
5 | end ) |
Thank you for reading, Chris.