Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Destroying vehicle when I spawn car with GUI?

I made a Car Spawn GUI . In Play mode it works fine but on server test the car is destroying + unable to seat. http://h32i.imgup.net/RobloxScref7cc.png

This is all script i done (SPAWN VEHICLE).

script.Parent.MouseButton1Click:connect(function()
c = game.Lighting.Car1:Clone()
c.Parent = game.Workspace
c:MoveTo(-5, 0.5, -38.5)
end)

2 comments

0

c:MakeJoints()

0

It don't work also.

1 answer

✓ Accepted answer

When you make a Vehicle in ROBLOX, you cannot collide parts together and have them hold together like that with Surface Joints. The way to fix this problem is by making a Weld script to hold everything in place allowing collisions to occur with other parts. Now, if you have your Vehicle connected together with Surface Joints (SurfaceType = either Studs,Input,Weld,ETC) and keeping it in workspace without using a script to clone it to workspace will not fall apart, you can put it in Lighting then when we clone it into workspace, make sure you use MakeJoints(). Bellow is a script that should work if your vehicle is made Correctly also don't forget to use a VEHICLE seat not a regular seat and use wheels correctly with a hinge.

script.Parent.MouseButton1Click:connect(function()
	c = game.Lighting.Car1:Clone()
	c.Parent = game.Workspace
	c:MakeJoints()
	c:MoveTo(-5, 0.5, -38.5)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.