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

Dont want to clone part,i didnt get error,i use server script, how to fix it?

Asked by
kiref81 -24
2 years ago
local part = script.Parent

newpart = part:Clone()
newpart.Parent = workspace.Parent

2 answers

Log in to vote
0
Answered by 2 years ago

You never defined where you want the part to spawn. Also, you can use Instance.new if you just want to spawn a single part and you tried to set its parent to the game, which to my knowledge will make it not spawn, although I could be wrong, set it to workspace, or if you have another folder then just set it to there.

https://www.youtube.com/watch?v=ivqeeFwcixg - an instance.new tutorial on youtube

local part = script.Parent

newpart = part:Clone()
newpart.Parent = game.Workspace
newpart.Position = Vector3.new("0,0,0") -- set the position you want it to be set to.

if you want to use Instance.new then although I suggest watching a tutorial here's a script to do so

local part = script.Parent

newpart = Instance.new("Part")
newpart.Parent = game.Workspace
newpart.Poisiton = Vector3.new("0,0,0") -- set to the position you want it to be set to in vector3

Tell me if that works!

0
First Vector3.new("0,0,0") dont need " " second it dont work kiref81 -24 — 2y
Ad
Log in to vote
0
Answered by
Befogs 113
2 years ago

The issue is you are setting the new part's parent to workspace.Parent, which is game. In order for your part to exist in the world you want the part to be a descendant of workspace. In order to fix this you can just set the parent of the new part to workspace.

newpart.Parent = workspace

Answer this question