-- DynDS 1.1.1
--------------------------------------------------------------------------------------------------

local P = script.Parent
local body = P.Parent
local car = body.Parent

for i,v in pairs(script:GetChildren()) do
	if (v:FindFirstChild("Car")) and (v.Car:IsA("ObjectValue")) then
		v.Car.Value = car
	end
end

P.ChildAdded:connect(function(child)
	if child:IsA("Weld") and (child.Part1) and (child.Part1.Name == "HumanoidRootPart") then
		local player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
		if (player) then
			for i,v in pairs(script:GetChildren()) do
				v:Clone().Parent = player.PlayerGui
			end
		end
	end	
end)
