script : local part = script.Parent
local carTemplate = workspace:FindFirstChild("Car")
local carSpawned = false
part.Touched:Connect(function(hit)
if carSpawned then
return
end
local character = hit.Parent
local humanoid = character and character:FindFirstChild("Humanoid")
if humanoid and carTemplate then
-- Clone the car
local carClone = carTemplate:Clone()
-- Spawn the car a little offset from the part
local spawnCFrame = part.CFrame + Vector3.new(5, 0, 0)
carClone:PivotTo(spawnCFrame)
carClone.Parent = workspace
carSpawned = true
end
end)
#greenville #roblox #viral #fyp #scripting #robloxstudio