Error Argument 1 missing or nil when firing a remove event. Can someone help me?
Asked by
7 years ago Edited 7 years ago
I have the following script in a part that you click:
It's a normal script
01 | local lobbyspawns = { game.Workspace.Lobby:WaitForChild( "s1" ).Position,game.Workspace.Lobby:WaitForChild( "s2" ).Position,game.Workspace.Lobby:WaitForChild( "s3" ).Position,game.Workspace.Lobby:WaitForChild( "s4" ).Position } |
02 | script.Parent:WaitForChild( "ClickDetector" ).MouseClick:connect( function (player) |
03 | local SavedPlayers = { } |
04 | table.insert(SavedPlayers,player.Name) |
05 | player.leaderstats.Money.Value = player.leaderstats.Money.Value + 250 |
06 | repeat wait() until player.Character |
07 | player.Character:WaitForChild( "CameraManipulation" ):WaitForChild( "RoundTheBus" ):FireClient() |
08 | local n = math.random( 1 , 4 ) |
09 | player.Character:WaitForChild( "HumanoidRootPart" ).CFrame = CFrame.new(lobbyspawns [ n ] ) + Vector 3. new( 0 , 2 , 0 ) |
And the following one in a *LocalScript*
01 | script.RoundTheBus.OnClientEvent:connect( function () |
02 | local player = game.Players.LocalPlayer |
03 | local cam = game.Workspace:WaitForChild( "Camera" ) |
06 | local target = game.Workspace:WaitForChild( "Bus" ):WaitForChild( "TheBus" ).Focus |
07 | local camera = workspace.Camera |
08 | camera.CameraType = Enum.CameraType.Scriptable |
09 | camera.CameraSubject = target |
13 | camera.CoordinateFrame = CFrame.new(target.Position) |
14 | * CFrame.Angles( 0 , angle, 0 ) |
15 | * CFrame.new( 0 , 10 , 15 ) |
16 | angle = angle + math.rad( 1 ) |
17 | if script:WaitForChild( "RoundThePlayer" ):WaitForChild( "Fired" ).Value = = true then |
For some reason, everytime I click it it says:
*Argument 1 missing or nil*
Why does this happen?
How do I fix this?
P.S: The "*RoundTheBus*" is inside that "*LocalScript*"