"attempt to index nil with clone" problem, how can i fix it? pls help.
Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).
this is my first time ever scripting and im making a story game on roblox. im making the lobby and everything is fine until the gui to exit the bus didnt pop up, i checked the output and it says "attempt to index nil with clone"
heres a part of my script
01 | script.Parent.Touched:Connect( function (hit) |
02 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
03 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
04 | for i,v in pairs (Seats) do |
05 | if Seats.Occupant = = nil then |
06 | hit.Parent.Humanoid.JumpPower = 0 |
07 | hit.Parent.Humanoid.WalkSpeed = 0 |
08 | Gui:Clone().Parent = player.PlayerGui < |
09 | player.Character.HumanoidRootPart.CFrame = Seats [ math.random( 1 , 17 ) ] .CFrame |
11 | player.PlayerGui.ExitGui:Destroy() |