Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

MakeJoints() isnt working correctly?

Asked by
RjsMc 48
6 years ago

So trying to spawn a Car using the Car Gui, everything works well, except when the car spawns. When the car spawns, the car happens to spawn around the player, but shatters when hit the ground, which does not make sense because the MakeJoints() function is there! Please help?

local c1cost = 10000
local player = game.Players.LocalPlayer
local leaderboard = player:WaitForChild("Values")
print(workspace:FindFirstChild(player.Name.."Car"))




local c1 = game.ReplicatedStorage.Cars["Toyota Prius"]:Clone() --Car





script.Parent.MouseButton1Click:connect(function()
    local search = workspace:FindFirstChild(player.Name.."Car")
    if (leaderboard.Coins.Value >= c1cost and leaderboard.Rebirth.Value >= 2) then
        if search == nil then
--Main Problem
            script.Parent.Text = "Spawning Car..."
            wait(1)
            script.Parent.Text = "Toyota Prius - "..c1cost
            script.Parent.Parent.Parent.Parent:TweenPosition(UDim2.new(0.02, 0,1.004, 0), "Out", "Quad", 1, false, nil)
        c1.Name = player.Name.."Car"
        c1.Parent = game.Workspace
        c1:MakeJoints()
        c1:MoveTo(player.Character.Torso.Position + Vector3.new(10, 0, 0))
        else
--Main Problem above





            search:Destroy()
            script.Parent.Text = "Previous Car Removed... Spawning Car"
            wait(1)
            script.Parent.Text = "Toyota Prius - "..c1cost
            script.Parent.Parent.Parent.Parent:TweenPosition(UDim2.new(0.02, 0,1.004, 0), "Out", "Quad", 1, false, nil)
        c1.Name = player.Name.."Car"
        c1.Parent = game.Workspace
        c1:MakeJoints()
        c1:MoveTo(player.Character.Torso.Position + Vector3.new(10, 0, 0))
        end




    else
        if leaderboard.Rebirth.Value >= 2 then
            script.Parent.Text = "Need $"..c1cost - leaderboard.Coins.Value
            wait(1)
            script.Parent.Text = "Toyota Prius - "..c1cost
        else

        end
    end
end)
0
Try using c1:MakeJoints() before parenting the model. Does that work? Eqicness 255 — 6y
0
:MakeJoints() only works for me if I can give the exact name of the model. It won't work for me if I do c:Clone():MakeJoints() GeminiDev 0 — 6y
0
None of these work. I am almost out of ideas on what to do... RjsMc 48 — 6y

Answer this question