03-17-2011, 08:28 PM
Try this. It will prevent the message from being shown more than once every 5 seconds.
[lua]
enabled = true
function TestHit(part)
if not enabled then return end
enabled = false
print(part.Parent.Name .. " has hit " .. script.Parent.Name)
game:chat(Color(100,100,0), "System: " .. part.Parent.Name .. " has won!")
sleep(5)
enabled = true
end
link(script.Parent.Collided, TestHit)
[/lua]
[lua]
enabled = true
function TestHit(part)
if not enabled then return end
enabled = false
print(part.Parent.Name .. " has hit " .. script.Parent.Name)
game:chat(Color(100,100,0), "System: " .. part.Parent.Name .. " has won!")
sleep(5)
enabled = true
end
link(script.Parent.Collided, TestHit)
[/lua]