--Config
local seat = script.Parent--The location of the seat, if you put this script inside the seat, you will not need to change it.
local CarName = "Lambo"--Change to Car name
--Do Not Edit Past This
seat.ChildAdded:connect(function(Child)
if Child.Name == "SeatWeld" then
local player = game.Players:GetPlayerFromCharacter(Child.Part1.Parent)
if (player) then
if player [CarName][CarName].Value == 2 then
else
Child:Destroy()
player.Character.Humanoid.Jump = true
Child.Part1.Parent.Humanoid.Jump = true
player.PlayerGui[CarName].Enabled = true--Shows them the purchase Gui!
wait()
player.Character.Humanoid.Jump = true
end
end
end
end)
Debug it with print() statements so you can confirm where the issue may lie more thoroughly:
--Config
local seat = script.Parent--The location of the seat, if you put this script inside the seat, you will not need to change it.
local CarName = "Lambo"--Change to Car name
print("Script running")
--Do Not Edit Past This
seat.ChildAdded:connect(function(Child)
print("Event fired")
if Child.Name == "SeatWeld" then
print("Found a child")
local player = game.Players:GetPlayerFromCharacter(Child.Part1.Parent)
if (player) then
print("Found player")
if player [CarName][CarName].Value == 2 then
print("Ok what's the use of this conditional check-")
else
Child:Destroy()
player.Character.Humanoid.Jump = true
Child.Part1.Parent.Humanoid.Jump = true
player.PlayerGui[CarName].Enabled = true--Shows them the purchase Gui!
wait()
player.Character.Humanoid.Jump = true
print("EA Sports")
end
end
end
end)