Ive tried everything. I am so annoyed. Can you fix this for me please?

local db = false
script.Parent.Touched:Connect(function(Hit)
	if db == false then
		db = true
		local Humanoid = Hit.Parent:FindFirstChild("Humanoid")
		if Humanoid then
			local Clone = Hit.Parent:Clone()
			if Clone then
				Clone.Parent = workspace
				local HRP = Clone:FindFirstChild("HumanoidRootPart")
				if HRP then
					HRP.CFrame = Hit.Parent.HumanoidRootPart.CFrame + Vector3.new(0, 6, 0)
				end
			end
		end
		wait(1)
		db = false
	end
end)

Basicly, Its a clone machine.

4 comments

1

There doesn't seem to be any problems that I can see, are there any errors?

0

I'm thinking that the computer is thinking the variable Clone is the function so maybe try changing the name of the variable from clone to something else and try again

0

Clone isn't a global tho

0

yes there are: attempt to index nil with 'Parent'