I am making a turret for my game and the :Clone() script thing that makes it go into player isn't working. Here is the script.

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()
				local Cont = script.Parent.Controls
				local PlrCont = Cont:Clone()
				PlrCont.Parent = player.Backpack
				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

6 comments

0

Is their any errors? If not try using the print function.

0

there is no errors and whats the print funtion?

0

do u want me to print("Funtion')?

0

If theres no errors then print and I dont want to print function

0

oh ok

0

there are no errors in output or anything and it doesnt print