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

Cloning script Problem?

Asked by 10 years ago
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)

1 answer

Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

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.

Ad

Answer this question