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

Script wont clone part from replicatedstorage. help?

Asked by 4 years ago
Edited 4 years ago

i am a newbie to scripting and my script didnt work, its in workspace and all the parts too my knowledge are Capitalized and spelt correctly

local players = game:GetService("Players");
local original = game:GetService("ReplicatedStorage").Part;


players.PlayerAdded:Connect(function()
    local newpart = original:Clone();
    newpart.parent = workspace;
    newpart:SetPrimaryPartCFrame(CFrame.new(0, 10, 0));
    end)

1 answer

Log in to vote
0
Answered by 4 years ago

Your scripting is right, but the formatting is off.

Also, using ; in scripts is not necessary and only really used in tables when working with LUA.

local players = game:GetService("Players")
local original = game:GetService("ReplicatedStorage") -- these are really here to make sure that they are loaded in before being used


players.PlayerAdded:Connect(function()
    local newpart = original.Part:Clone() -- cloning the part directly.
    newpart.parent = game.workspace
    newpart:SetPrimaryPartCFrame(CFrame.new(0, 10, 0))
end)

Hope this helps!

0
Hey i tried your method, but it didnt work, it is a regular script in workspace if that helps. pokemonzizzle8383 6 — 4y
Ad

Answer this question