model = script.Parent.Parent.Parent.CarSeat.Value.Parent.Parent
function onclick ()
sell = script.Parent.Parent.Parent.sell.Value
local stats = game.Players.LocalPlayer:FindFirstChild("leaderstats")
if stats ~= nil then
local cash = stats:FindFirstChild("Money")
cash.Value = cash.Value + sell
script.Parent.Parent.Parent:Destroy()
script.Parent.Parent.Parent.Parent.Parent.Parent:remove()
end
end
script.Parent.MouseButton1Click: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

3 comments
What are you trying to do with this?
it is a script for selling stuff
its ok guys i figured the problem my self i fixed the problem the script works fine now