generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Welding Issue

Previous Thread :: Next Thread 
OnlineOne is online. 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
Themultipikachiu is online. Themultipikachiu
Joined: 27 Nov 2015
Total Posts: 272
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image