local Target = script.Parent
local Num = script.Parent.Value
function onClick()
local Clone = Target:Clone()
Clone.Cframe = Cframe.new(Target.Position) --Problem is here.
Clone.Name = "Clone" .. Num.Value
Num.Value = Num.Value + 1
Clone.Parent = game.Workspace
end
Target.ClickDetector.MouseClick:connect(onClick)
✓ ANSWER ACCEPTED
Cloning script Problem?
1 answer
✓ Accepted answer
Variable and property names are case sensitive in Lua.
CFrame is capitalized as CFrame and NOT as CFrame. The error message would have given you a direction to tell this from:
'Cframe' is not a valid member of Part
or something similar.
In the future please provide a clearer question when submitting to Scripting Helpers. Just posting code and stating that it "doesn't work" is frankly insulting.
This discussion is preserved as it was. New answers, comments, and votes are closed.
