Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Script wont clone part from replicatedstorage. help?

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

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!

1 comment

0

Hey i tried your method, but it didnt work, it is a regular script in workspace if that helps.

This discussion is preserved as it was. New answers, comments, and votes are closed.