I would like to clone a part in a LocalScript while maintaining the functionality of the script within said part. The issue is that once cloned, the part’s script ceases to work.
My understanding is that this does not work because you can’t clone a server script in a LocalScript. So, I thought I’d use a Remote Function and do the cloning in a server script.
This is what the server script used to clone looks like:
local function onCloneBall(player,character,ball) local clientBall = ball:Clone() clientBall.Parent = game.Workspace clientBall.CanCollide = true return clientBall end cloneBall.OnServerInvoke = onCloneBall
It takes in a ball that I want to be cloned.
In the LocalScript:
local clientBall = cloneBall:InvokeServer(character,projectile)
I retrieve the cloned ball, called ‘clientBall’.
Yet the problem still persists – the script within the cloned ball does not work.
I don’t understand why this is the case? I use a RemoteFunction to do the cloning from the server script, so I don’t really understand why it isn’t working. Any help would be appreciated!