local dp = true

script.Parent.Touched:connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") ~= nil then
		if dp == true then
			dp = false
			script.Parent.BrickColor = BrickColor.new("Reddish brown")
			local player = game.Players:GetPlayerFromCharacter(hit.Parent)
			player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 5
			script.Parent.CFrame = CFrame.new(144.55, 18.9, 103.6)
			local coincollectsound = script.Sound
			coincollectsound.Playing = true
			wait(.5)
			script.Parent.CFrame = CFrame.new(144.55, 17.9, 103.6)
			wait(3)
			dp = true
			script.Parent.BrickColor = BrickColor.new("Gold")
		end
	end
end)

4 comments

0

What?

0

Nice try. Show the full script. This is obviously the wrong script; or not the entire script.

0

Proberly an infenite loop without a wait Only when i make that mistake it says that.

0

H4X I’m not that great at scripting so I just watched a video on how to do that.