local car1 = game:GetService("ReplicatedStorage")["Car"]
local backup = car1:clone()
local car2 = game:GetService("ReplicatedStorage")["Van"]
local backup = car1:clone()
local car3 = game:GetService("ReplicatedStorage")["Off-Roader"]
local backup = car1:clone()
carN = script.Parent.Parent.carValue
local carV
cooldown = false
function Regen()
if(carN.Value == 1) then
carV = car1
print("set to Sedan")
end
if(carN.Value == 2) then
carV = car2
print("set to Van")
end
if(carN.Value == 3) then
carV = car3
print("set to Jeep")
end
if(cooldown == false) then
carV = backup:clone()
carV.Parent = game.Workspace
carV:makeJoints()
carV:SetPrimaryPartCFrame (script.objectValue.Value.CFrame+Vector3.new(0,5,0))
carV:SetPrimaryPartCFrame (car1.PrimaryPart.CFrame * CFrame.Angles(0,math.rad(180), 0))
print(carV.PrimaryPart)
cooldown = true
script.Parent.Text = "On Cooldown"
wait(12)
cooldown = false
script.Parent.Text = "Build"
end
end
script.Parent.MouseButton1Down:connect(Regen)
Can someone look at this and tell me if im referencing/setting variables correctly |