Why won't this car script work?
I tried to make it so if a user has a gamepass, it clone's the gui and change's the parent to the player, it prompt's the user to purchase the gamepass, even if they have it. Can someone tell me what I did wrong?
11 | script.Parent.ChildAdded:connect( function (it) |
12 | if it:IsA( "Weld" ) then |
13 | tempcur = it.Part 1. Parent |
14 | if cur ~ = tempcur and cur ~ = nil then tempcur.Humanoid.Sit = false return end |
15 | if cur = = tempcur then print ( "same guy!" ) return end |
19 | local Player = game.Players:GetPlayerFromCharacter(cur) |
20 | for _,i in pairs (Check) do |
21 | if i = = game:GetService( "MarketplaceService" ):PlayerOwnsAsset(Player,gamepass) then |
23 | if Player.PlayerGui:findFirstChild( "Car" ) then |
28 | for _,i in pairs (Blacklist) do |
34 | game:GetService( "MarketplaceService" ):PromptPurchase(Player,gamepass) |
35 | cur.Humanoid.Sit = false |
38 | print (tempcur.Name.. " was booted" ) |
39 | script.Parent.Parent.Parent = workspace |
41 | script.Car:Clone().Parent = Player.PlayerGui |
42 | game.Players:GetPlayerFromCharacter(cur).PlayerGui.Car.Frame.Seat.Value = script.Parent |
43 | game.Players:GetPlayerFromCharacter(cur).PlayerGui.Car.Frame.LocalScript.Disabled = false |
44 | script.Parent.Parent.Parent = cur |
46 | elseif it:IsA( "IntValue" ) then |
47 | print ( "Bye Bye user!" ) |
50 | script.Parent.Parent.Parent = workspace |