9
3

testscript.lua 1008 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --[[
  2. Script Name : SpawnScripts/Generic/testscript.lua
  3. Script Author : Cynnar
  4. Script Date : 2022.04.15 07:04:19
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. end
  10. function hailed(NPC, Spawn)
  11. gettinggroups = GetGroup(NPC)
  12. local currentlevel = GetLevel(NPC)
  13. Say(NPC, "My current level is: " .. currentlevel)
  14. local minlevel = 32
  15. Say(NPC, "The Min level is: " .. minlevel)
  16. local maxlevel = 38
  17. Say(NPC, "The Max level is: " .. maxlevel)
  18. math.randomseed(os.time())
  19. local newlevel = math.random(minlevel, maxlevel)
  20. SpawnSet(NPC, "level", newlevel )
  21. Say(NPC, "My new level is: " .. newlevel)
  22. if gettinggroups == nil then
  23. Say(NPC, "I do not speak to loners...")
  24. else
  25. FaceTarget(NPC, Spawn)
  26. for k,v in ipairs(gettinggroups) do
  27. Say(NPC, GetName(v))
  28. SpawnSet(v, "level" .. newlevel)
  29. end
  30. end
  31. end
  32. function respawn(NPC)
  33. spawn(NPC)
  34. end