• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

PVP Enforce script

gurden

i need support for my server, good scripter!
Joined
May 19, 2009
Messages
519
Reaction score
5
Location
Sweden
I wonder if there is any globalevents scripts who make the server PVP Enforce for a several min like 1 hour and then it goes pvp again. ?
 
Last edited:
<globalevent name="NAME" interval="3600" event="script" value="NAME.lua"/>

LUA:
local pvp = {
    
    worldtype = getWorldType()
     msgP = "Server Just change to Pvp Enforced"
     msgE = "Server Just change to Pvp Normal"
      
       }
     
   
     function onThink(interval, lastExecution)
    
                if(pvp.worldtype == 1) then
                        doBroadcastMessage(' '.. pvp.msgP ..' ')
                         setWorldType(pvp-enforced)
                     elseif(pvp.worldtype = 3)
                          doBroadcastMessage(' '.. pvp.msgE ..' ')
                      setWorldType(pvp)
                end
 
                end
    return TRUE
end

Maybe?
 
[Warning - Event::loadScript] Cannot load script (data/globalevents/scripts/enforce.lua)
[10/09/2009 14:50:20] data/globalevents/scripts/enforce.lua:4: '}' expected (to close '{' at line 1) near 'msgP'
 
[Warning - Event::loadScript] Cannot load script (data/globalevents/scripts/enforce.lua)
[10/09/2009 14:50:20] data/globalevents/scripts/enforce.lua:4: '}' expected (to close '{' at line 1) near 'msgP'


LUA:
local config = {
    
    worldtype = getWorldType()
      
       }
     
   
     function onThink(interval, lastExecution)
    
                if(pvp.worldtype == 1) then
                        doBroadcastMessage("Local GameMaster:Server Just change to Pvp Normal")
                         setWorldType(pvp-enforced)
                     elseif(pvp.worldtype = 3)
                          doBroadcastMessage("Local GameMaster:Server Just change to Pvp Normal")
                      setWorldType(pvp)
                end
 
                end
    return TRUE
end
 
[10/09/2009 21:01:18] [Warning - Event::loadScript] Cannot load script (data/globalevents/scripts/enforce.lua)
[10/09/2009 21:01:18] data/globalevents/scripts/enforce.lua:13: ')' expected near '='
 
[10/09/2009 21:01:18] [Warning - Event::loadScript] Cannot load script (data/globalevents/scripts/enforce.lua)
[10/09/2009 21:01:18] data/globalevents/scripts/enforce.lua:13: ')' expected near '='

LUA:
elseif(pvp.worldtype = 3)
try change to
LUA:
elseif(pvp.worldtype == 3)
 
LUA:
local pvp = {
    
    worldtype = getWorldType(),
     msgP = "Server Just change to Pvp Enforced",
     msgE = "Server Just change to Pvp Normal"
      
       }
     
   
     function onThink(interval, lastExecution)
    
                if(pvp.worldtype == 1) then
                        doBroadcastMessage(' '.. pvp.msgP ..' ')
                         setWorldType(pvp-enforced)
                     elseif(pvp.worldtype == 3) then
                          doBroadcastMessage(' '.. pvp.msgE ..' ')
                      setWorldType(pvp)
                end
 
                end
    return TRUE
end
 
well at@ why use Local pvp??? new on scripting????

Local config
...

LUA:
local config = {
    
    worldtype = getWorldType()
      
       }
     
   
     function onThink(interval, lastExecution)
    
                if(pvp.worldtype == 1) then
                        doBroadcastMessage("Local GameMaster:Server Just change to Pvp Normal")
                         setWorldType(pvp-enforced)
					 if(pvp.worldtype == 3) then
                          doBroadcastMessage("Local GameMaster:Server Just change to Pvp Normal")
                      setWorldType(pvp)
                end
 
                end
    return TRUE
end
tested and worked 0.3.5pl1
 
ahhuauhauh saying noobs to others??
u noob man
it should not work because you use the local config and put the local pvp!
noob! :@
LUA:
local pvp = {
    worldtype = getWorldType(),
    msgP = "Server Just change to Pvp Enforced",
    msgE = "Server Just change to Pvp Normal"
    }
     
     function onThink(interval, lastExecution)
        if(pvp.worldtype == WORLD_TYPE_PVP) then
            doBroadcastMessage(pvp.msgP)
            setWorldType(WORLD_TYPE_PVP_ENFORCED)
        elseif(pvp.worldtype == WORLD_TYPE_PVP_ENFORCED) then
            doBroadcastMessage(pvp.msgE)
			setWorldType(WORLD_TYPE_PVP)
		end
    return TRUE
end
 
lol tested and works..
Code:
10:40 Server Just change to Pvp Normal
10:40 World type is currently set to PVP.
10:41 Server Just change to Pvp Enforced
10:41 World type is currently set to PVP-Enforced.
LUA:
  local pvp = {
    msgP = "Server Just change to Pvp Enforced",
    msgE = "Server Just change to Pvp Normal"
    }
     
     function onThink(interval, lastExecution)
        if(getWorldType() == 2) then
            doBroadcastMessage(pvp.msgP)
            setWorldType(3)
        elseif(getWorldType() == 3) then
            doBroadcastMessage(pvp.msgE)
            setWorldType(2)
        end
    return TRUE
end
 
Last edited:
lol tested and works..
Code:
10:40 Server Just change to Pvp Normal
10:40 World type is currently set to PVP.
10:41 Server Just change to Pvp Enforced
10:41 World type is currently set to PVP-Enforced.
LUA:
  local pvp = {
    msgP = "Server Just change to Pvp Enforced",
    msgE = "Server Just change to Pvp Normal"
    }
     
     function onThink(interval, lastExecution)
        if(getWorldType() == 2) then
            doBroadcastMessage(pvp.msgP)
            setWorldType(3)
        elseif(getWorldType() == 3) then
            doBroadcastMessage(pvp.msgE)
            setWorldType(2)
        end
    return TRUE
end

Work fine too
 
Back
Top