What is wrong in this script?
Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
01 | model = script.Parent.Parent.Parent.CarSeat.Value.Parent.Parent |
04 | sell = script.Parent.Parent.Parent.sell.Value |
05 | local stats = game.Players.LocalPlayer:FindFirstChild( "leaderstats" ) |
07 | local cash = stats:FindFirstChild( "Money" ) |
08 | cash.Value = cash.Value + sell |
09 | script.Parent.Parent.Parent:Destroy() |
10 | script.Parent.Parent.Parent.Parent.Parent.Parent:remove() |
15 | script.Parent.MouseButton 1 Click:connect(onclick) |
it says:
00:01:16.443 - Players.Player.PlayerGui.Screen.Frame.TextButton.Script:10: attempt to index field 'Parent' (a nil value)
00:01:16.444 - Script 'Players.Player.PlayerGui.Screen.Frame.TextButton.Script', Line 10