So I was making a rock dropping script for when a player goes up the mountain, a rock will fall and maybe kill that player. When I was testing it, there was no error on my output but it didn't work. Is there any error on my script that I should fix? (Script Below)

Script:

local rock = game.ReplicatedStorage.RockFaller

rock.Touched:Connect(function(hit)

	if hit.Parent:FindFirstChild("Humanoid") then
		
		hit.Parent.Humanoid.Health = 0
	
	end

	local temple = game.Workspace.DesertTemple

	temple.Touched:Connect(function(hit)
	
		if hit.Parent:FindFirstChild("Humanoid") then
		
			wait(1)
		
			local rock = game.ReplicatedStorage.RockFaller

			local rockclone = rock:Clone()
		
			rockclone.Parent = workspace
		
			wait(2)
		
			rockclone:Destroy()
		
		
		
		end
	end

2 comments

0

wait: so does the rock spawn? idk if it seems like it in this script so

0

no the rock does not spawn