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)
COMMUNITY QUESTION
How do i fix this? it keeps saying this script has been running a long time.
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
What?
Nice try. Show the full script. This is obviously the wrong script; or not the entire script.
Proberly an infenite loop without a wait Only when i make that mistake it says that.
H4X I’m not that great at scripting so I just watched a video on how to do that.