View Full Version : Player Detected Alarm
Yasuo
01-13-2016, 03:46 PM
Hello, I need switcher for Player Detected Alarm, I mean when my character enter spawn it will alarm when player in on the screen, but when he exit spawn and go refil it won't alarm, is it possible :) ?
eldera
01-13-2016, 07:29 PM
Set PLAER_ALARM to true whenever you want to switch it on and set it to false whenever you want to switch it off.
registerNativeEventListener(WALKER_SELECTLABEL, 'onLabel')
function onLabel(name)
if (name == "startHunt") then
PLAYER_ON_SCREEN_ALARM = true
return
end
if (name == "leaveRespawn") then
PLAYER_ON_SCREEN_ALARM = false
return
end
end
--[[ DO NOT EDIT ANYTHING BELOW THIS LINE ]]--
Module.New("player-on-screen-alarm", function()
if (Creature.iPlayers()() and PLAYER_ON_SCREEN_ALARM) then
print("PLAYER ON SCREEN ALARM!")
alert()
end
end)
dean015
01-13-2016, 07:47 PM
thanks this is really helpful the ammount of times i rush to pc to find im in dp is a lot lol
Yasuo
01-15-2016, 01:02 PM
Set PLAER_ALARM to true whenever you want to switch it on and set it to false whenever you want to switch it off.
registerNativeEventListener(WALKER_SELECTLABEL, 'onLabel')
function onLabel(name)
if (name == "startHunt") then
PLAYER_ON_SCREEN_ALARM = true
return
end
if (name == "leaveRespawn") then
PLAYER_ON_SCREEN_ALARM = false
return
end
end
--[[ DO NOT EDIT ANYTHING BELOW THIS LINE ]]--
Module.New("player-on-screen-alarm", function()
if (Creature.iPlayers()() and PLAYER_ON_SCREEN_ALARM) then
print("PLAYER ON SCREEN ALARM!")
alert()
end
end)
Love you man, I need to change names of labels, yeah?
Kociii
01-15-2016, 01:27 PM
Love you man, I need to change names of labels, yeah?
No you don't. You just need to change the labelname in the file =)
eldera
01-15-2016, 02:06 PM
Love you man, I need to change names of labels, yeah?
No, everything above --[[ DO NOT EDIT ANYTHING BELOW THIS LINE ]]-- is just an example how to use it. Basicially just use:
PLAYER_ON_SCREEN_ALARM = true
when you want to turn alarm on or use:
PLAYER_ON_SCREEN_ALARM = false
when you want to turn it off. If you still don't understand how to do it show me your lua and I will show you how to adapt it to your script.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.