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 AdditionEvent = RS:WaitForChild('AdditionEvent') local Block = game.Workspace.Block AdditionEvent.OnServerEvent:Connect(function(event) Block:Clone() Block.CFrame = Block.CFrame * (0,4,0) Block.SurfaceGui.TextLabel.Text +=1 end)
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 AdditionEvent = RS:WaitForChild('AdditionEvent') local Block = game.Workspace.Block local CurrentNumber = 1 local CurrentCFrame = Block.CFrame AdditionEvent.OnServerEvent:Connect(function(event) local ClonedBlock = Block:Clone() ClonedBlock.Parent = workspace CurrentCFrame = CurrentCFrame * CFrame.new(0,4,0) ClonedBlock.CFrame = CurrentCFrame CurrentNumber = CurrentNumber + 1 ClonedBlock.SurfaceGui.TextLabel.Text = CurrentNumber end)