1

How to clone object but constantly keep changing it's properties?

R0jym 42
1 month ago

Hello there, I have a script here where it's supposed to clone itself BUT continously update it's properties everytime it is cloned, like in this script where it's numbers add everytime it is cloned along with it's position, however I do not know on how to approach this and it does not seem to work, how do I remedy this?

local RS = game:GetService('ReplicatedStorage')
local Block = game.Workspace.Block

Block:Clone()
Block.CFrame = Block.CFrame * (0,4,0)
Block.SurfaceGui.TextLabel.Text +=1
end)

0
You are trying to set the CFrame of the block that is in the workspace, and not the cloned one. ROMAHKAO 35 — 1mo

1
Edited 1 month ago

You would want to put the Cloned Block into a Variable as i think you cant access the Cloned block if you dont also you forgot to place the cloned block in workspace and you also need to have a currentNumber or it would add Block.SurfaceGui.TextLabel.Text as 0 to 1 then it would add 1 to 0 again after it cloned again like this

local RS = game:GetService('ReplicatedStorage').Remotes
local Block = game.Workspace.Block
local CurrentNumber = 1
local CurrentCFrame = Block.CFrame