OnlineOne
|
  |
| Joined: 14 Jul 2011 |
| Total Posts: 1193 |
|
|
| 01 Feb 2017 06:46 PM |
The script is supposed to weld and respawn a vehicle from the ServerStorage. It's spawning the vehicle usually, but sometimes the vehicle spawns in an unknown location. Please help.
local parent = script.Parent local debouncing = false local currentVehicle = game local cooldownTime = 0.8--Cooldown between respawning the vehicle local vehicleName = "Vehicle"--Vehicle name, put vehicle in server storage as a model
parent:WaitForChild("ClickDetector").MouseClick:connect(function() if debouncing == false then if currentVehicle.Parent == game.Workspace then currentVehicle:Destroy() end debouncing = true local vehicle = game.ServerStorage:FindFirstChild(vehicleName):Clone() vehicle.Parent = game.Workspace currentVehicle = vehicle for _, child in pairs(vehicle:GetChildren()) do for _, childToWeldWith in pairs(vehicle:GetChildren()) do local weld = Instance.new("Weld", child) weld.Part0 = child weld.C0 = child.CFrame:inverse() weld.Part1 = childToWeldWith weld.C1 = childToWeldWith.CFrame:inverse() end end wait(cooldownTime) debouncing = false end end)
--Online |
|
|
| Report Abuse |
|
|
| 01 Feb 2017 07:04 PM |
| have u tried specifying the location of the vehicle with x and y coordinates? For vehicle respawning you should take apart a vehicle respawn script and study that. usually respawn scripts require 2 scripts, one in the vehicle and the other in the block |
|
|
| Report Abuse |
|