Again, this website is not meant for requests.
Put this code inside a part, and put your model in ServerStorage.
local TIMEOUT = false
local RECHARGE = 3
local CAR_NAME = "car"
script.Parent.Touched:Connect(function(t)
if t.Parent:IsA("Model") then
if t.Parent:FindFirstChildOfClass("Humanoid") then
local p = game.ServerStorage:FindFirstChild(CAR_NAME)
if p then
if TIMEOUT == false then
TIMEOUT = true
local c = p:Clone()
c.Parent = game.Workspace
if c:IsA("Model") then
c:SetPrimaryPartCFrame(CFrame.new(script.Parent.Position - script.Parent.CFrame.LookVector*-1))
else
c.Position = script.Parent.Position - script.Parent.CFrame.LookVector*-7
end
local oldColor = script.Parent.Color
script.Parent.Color = Color3.new(1,0,0)
wait(RECHARGE)
TIMEOUT = false
script.Parent.Color = oldColor
end
end
end
end
end)
In the future, please do not post requests (asking people to write scripts or make models) and ask for help (e.g - how do i do this, what is wrong with this segment of code)
1 comment
This is a request. requests are against scriptinghelpers rules. I will do it though