Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Need Scripting help on roblox! -Murder game issues with teleporting players to map-?

Asked by 6 years ago

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:

01local knife = game.ServerStorage:WaitForChild('Knife')
02local gun = game.ServerStorage:WaitForChild('Revolver')
03local status = game.ServerStorage:WaitForChild('Status').Value
04local plrsneeded = 1
05local stopgame = false
06local gameon = false
07local mapnames = {'Combat League By Parasc'}
08local putmapsinworkspace = false
09local Maps = game.ServerStorage:WaitForChild('Maps')
10local MapFolder = game.Workspace:WaitForChild('Map')
11local MapFound = false
12local player1 = nil
13local player2 = nil
14local player3 = nil
15local player4 = nil
View all 95 lines...

Thank you for reading, ChrisThrRoblox1234 (Chris) P.S. I would like this to be fixed quickly if possible!

0
You should short your code and show scripters where the error is or telling us on what line is error. You have to get the line of error in output. AswormeDorijan111 531 — 6y
0
FindFirstChild(player1) when player1 is nil...maybe you mean FindFirstChild("Player1")? I don't really know, but that's the error anyway Vulkarin 581 — 6y
0
NumPlayers is deprecated. User#19524 175 — 6y
0
Guys this is now resolved! ChrisThrRoblox1234 12 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago
1if putmapsinworkspace == true then
2    local map = Maps:FindFirstChild(mapnamethatwaspicked)
3    map.Parent = MapFolder
4elseif 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...
0
Actually its set to false because there is only currently 1 map (which is already in workspace so there is no need to do that.) ChrisThrRoblox1234 12 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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:

1script.Parent.Text = game.ServerStorage.Status.Value
2 
3game.ServerStorage.Status.Changed:Connect(function()
4    script.Parent.Text = game.ServerStorage.Status.Value
5end)

Thank you for reading, Chris.

0
The Status isn't changing the text because you put the Status in ServerStorage, which the Client can't access. Put the Status in ReplicatedStorage saSlol2436 716 — 6y
0
By the way, looking at an image, your script in your TextLabel should be a LocalScript saSlol2436 716 — 6y

Answer this question