Welcome to the Forums!
Join thousands of other Roblox members with a free account.
Create Forum Account

Problems with :MakeJoints()

  • This website was created by Roblox members to replace the official forums (because Roblox shut them down) Join us if you like Roblox!
Status
Not open for further replies.

GeminiSage

New Member
Reputation: 0 / 0 / 0
Dec 15, 2017
1
0
1
I am trying to clone() a car from ServerStorage and I was informed that I needed to call :MakeJoints() on the clone. I tried doing :Clone():MakeJoints() and that didn't work but it did if I named the model. The problem is that the car spawns every time someone respawns for their character, there will be a lot with the same name, and the car breaks without :MakeJoints(). I thought a good solution would be to name the model a name and have an increasing variable but I can't seem to get that to work.. Does anyone have a solution? Here is the code:

function onSpawned(plr)
local kart = game.ServerStorage["Cart"]:Clone()
kart.Parent = game.Workspace
kart:MakeJoints()
end

function onChanged(prop,plr)
if prop=="Character" then
onSpawned(plr)
end
end

function onAdded(plr)
plr.Changed:connect(function(prop)
onChanged(prop,plr)
end)
end

game.Players.PlayerAdded:connect(onAdded)
 

Chrome4fan

New Member
Reputation: 0 / 0 / 0
Jan 21, 2018
10
1
3
This is my setup, however, mine works by having a GUI button and it spawns a car.

repeat wait() until game.Players.LocalPlayer.Character
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Rp = game.ReplicatedStorage
local V1 = Rp.Vehicles.Fast
exist = 0

script.Parent.Fast.MouseButton1Click:connect(function()

local ClonedVehicle = V1:Clone()
ClonedVehicle.Parent = workspace
ClonedVehicle:MakeJoints()
ClonedVehicle.PrimaryPart = ClonedVehicle.Main
ClonedVehicle:SetPrimaryPartCFrame(Character.Head.CFrame)

end)
 
Status
Not open for further replies.