So I am trying to get relative position/Cframe of a button-model on a templateplot-model and setting another button/cloned button-model on another plot-model
But I’m getting this error
TOWorldSpace is not a valid member of Model "Workspace.Plots.Plot"
Snippet of the script
local templatebutton = Workspace.TemplatePlot.Buttons
local templateitems = Workspace.TemplatePlot.Items
--Spawn check if the plots is owned
--Check IF the plot has been claimed
if plot:GetAttribute("Taken") == true then
--Create a loop FOR the "buttons" in templatebutton
for i, v in pairs(templatebutton:GetChildren()) do
--Clone the buttons and parent it to plot.buttons
local plotbutton = v:Clone()
plotbutton.Parent = plot.Buttons
--Get relative position of the buttons on the templateplot and set it on the plot
local relativeposition = templateplot.PlotFloor.CFrame:ToObjectSpace(v:GetPivot())
v:PivotTo(plot:ToWorldSpace(relativeposition))
end
end
Btw the plot model consist of plotdoor and plotfloor part