local human = script.Parent:WaitForChild("Humanoid")
local center = game.Workspace.CentralPart
local debounce = false
while wait(2.5) do
	local random = Random.new()
local random2 = Random.new()
local range = random:NextInteger(-50, 50)
local range2 = random2:NextInteger(-50, 50)
	local wave = game.ReplicatedStorage.Ring:Clone()
	human.Jump = true
	human:MoveTo(center.Position + Vector3.new(range, 0, range2))
	human.MoveToFinished:Connect(function()
		if human.Jump == false then
		wave.Position = Vector3.new(script.Parent:WaitForChild("Torso").Position.X, 80.28, script.Parent:WaitForChild("Torso").Position.Z)
		wave.Parent = workspace
		script.Parent.Sound:Play()
		wave.Touched:Connect(function(hit)
			local hithum = hit.Parent:FindFirstChild("Humanoid")
			if hithum then
				if hithum ~= human and debounce == false then
					debounce = true
					hithum.Health = hithum.Health - 60
					wait(1)
					debounce = false
		end
	end
end)
		for i = 1, 50 do
			wave.Size = wave.Size + Vector3.new(3, 0, 3)
			wait()
		end
		end
		wave:Destroy()
	end)
end

Defining the variable wave before the movetofinished event would result in the wave getting deleted, but the next one would have one more than the previous cycle. The script works as intended now, but it outputs the error "Parent property of ring locked, current parent:NULL, new parent: Workspace.

1 comment

0

if i knew it i would tell you but i simply dont