I want to clone the turret into the player because if there is 2 turrets with the same name on a battleship there's a chance that whenever you shoot the turret the bullet with come out of the other turret. Here's what I did

function onChildAdded(part)
	if part.className == "Weld" then
		local torso = part.Part1
		if torso ~= nil then
			local parent = torso.Parent
			if parent ~= nil then
				local player = game.Players:findFirstChild(parent.Name)
				local turret = script.Parent.Parent
				local Turret = turret:Clone()
				Turret.Parent = player.Backpack				
			end
		end
	end
end


function onChildRemoved(part)
local player1 = game.Players:findFirstChild(script.Parent.Parent.Parent.Name)
player1.Backpack.Turret:remove()
end

2 comments

0

wait nvm i never used CLone mb

0

I still didnt clone ;-;