I'm making a car crash game, I finally figured how to make respawning cars without it breaking however, I'm still having problems adding the part to make it crash... The part spawns underneath the vehicle glitching it out, all i need to know is if i can weld it to the front surface of a block aka the bumper. I tried with .Surface but it didn't work saying it was not a part of part, here is my code still with where i tried .Surface. ALL I NEED TO KNOW IS IF THERE IS A WAY TO WELD IT TO A SURFACE IF IT JUST SPAWNS IN.
``local van = game.ServerStorage.RespawnVan local JustSpawned = false local CHitPart = game.ServerStorage.HitPart
function summon() if script.Parent.MouseClick then local clone = van:Clone() clone.Parent = game.Workspace game.Workspace.RespawnVan:MakeJoints() JustSpawned = true wait(5) JustSpawned = false --Im testing this stuff-- wait(20) local clone2 = CHitPart:Clone()
local weld = Instance.new("WeldConstraint")
weld.Part0 = clone2
--You can change weld.Part1 if you don't have a PrimaryPart
weld.Part1 = clone.FBumper.Surface.FrontSurface --Testing I still don't know what to do
weld.Parent = clone2
clone2.Parent = game.Workspace.RespawnVan
print("HitPart has spawned!")
print(clone2.Parent)
script.Parent.Script.Disabled = false
end
end
script.Parent.MouseClick:Connect(summon)
Just please tell me if you can help, i've been trying for months.. But i'm actually starting to get somewhere if i get past this final step me and my friends can actually play it and fun without constantly having to leave because all the cars are broken.
Thanks
