local House = script.Parent.Parent.House
local HouseTabel = {
House.A,
House.B,
}
while wait(3) do
local RandomHouseNumbers = math.random(1,#HouseTabel)
local RandomHouseClone = HouseTabel[RandomHouseNumbers]
local RandomPostionX = math.random(1,816.737)
local RandomPostionZ = math.random(1,553.81)
local HouseClone = RandomHouseClone:Clone()
HouseClone.Parent = script.Parent.Parent.House
HouseClone.CFrame = CFrame.new(RandomPostionZ,100,RandomPostionX)
end```
error code
``` 05:55:41.149 CFrame is not a valid member of Model "Workspace.HouseRain.Mine.House.A"````
if you have a primarypart set in the model you can set the cframe of that part or you can pivot the model
HouseClone.PrimaryPart.CFrame = CFrame.new(RandomPostionZ,100,RandomPostionX)
or
HouseClone:PivotTo(CFrame.new(RandomPostionZ,100,RandomPostionX))
1 Like
its not work idont nkow why
its same error
As mentioned, you probably should have a PrimaryPart set in the Model. The PrimaryPart you want to set is the part you want to change the CFrame for.
1 Like