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

How do you make an object clone near the local client?

Asked by 4 years ago

I would like to know how to make an object clone near a character, I am currently making a drifting/driving game and I would like this info to spawn a car. Sorry if this is super simple, I am new to scripting, I only know basic GUI scripting. Here is the script I am using:

script.Parent.MouseButton1Click:connect(function(GetCar)
        Mod = game.ServerStorage.ToyotaSupra
        clone = Mod:clone(-230.75, 0.5, -18)
        clone.Parent = workspace
        clone:MakeJoints()
end)

I tried using this:

mod.Position = Vector3.new(*A random pos to test*)

did nothing, help?

0
Mod:MoveTo(Vector3.new(X, Y, Z)) User#31525 30 — 4y
0
Didn't work brokenboss66 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You can't have anything between the brackets in Clone(). Also, I added local before Mod = game... because I think you need local before the variable to actually create the variable

script.Parent.MouseButton1Click:connect(function(GetCar)
        local Mod = game.ServerStorage.ToyotaSupra
        clone = Mod:Clone()
        clone.Parent = workspace
    clone.PrimaryPart.CFrame = CFrame.new(Vector3.new(-230.75, 0.5, -18))
        clone:MakeJoints()
end)
0
Doesn't seem to work brokenboss66 0 — 4y
Ad

Answer this question