Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local config = {
- ["group"] = {"Druid", "Sorcer", "Knight"},
- ["amount"] = 3, -- amount of friends on screen to break function
- ["distance"] = 7, --default on screen
- }
- GetDistanceFromPlayers = function (players, distance)
- local c = Self.GetSpectators()
- local count = 0
- for i = 1, #c do
- if c[i]:isPlayer() and c[i]:isOnScreen() and c[i]:DistanceFromSelf() <= distance then
- if table.find(players, c[i]:Name()) then
- count = count + 1
- end
- end
- end
- print(count)
- return count
- end
- registerEventListener(WALKER_SELECTLABEL, "onLabel")
- function onLabel(label)
- local label = label:lower()
- if label == "waitmc" then
- if GetDistanceFromPlayers(config.group, config.distance) < config.amount then
- setWalkerEnabled(false)
- else
- setWalkerEnabled(true)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement