Jump to content

Recommended Posts

local rev = string.format("local w,h = TheWorld.Map:GetSize();for _,v in pairs(AllPlayers) do for x=-w*4,w*4,35 do for y=-h*4,h*4,35 do v.player_classified.MapExplorer:RevealArea(x,0,y) end end end")
local fog = string.format("TheWorld.minimap.MiniMap:EnableFogOfWar(false)")

local function revealer( inst )
    
    if GLOBAL.TheNet:GetIsClient() and GLOBAL.TheNet:GetIsServerAdmin() then
        GLOBAL.TheNet:SendRemoteExecute(rev, x, z)    
    else
        GLOBAL.ExecuteConsoleCommand(rev)
    end
    
end

local function revealer2(inst)

    if GLOBAL.TheNet:GetIsClient() and GLOBAL.TheNet:GetIsServerAdmin() then
        GLOBAL.TheNet:SendRemoteExecute(fog, x, z)    
    else
        GLOBAL.ExecuteConsoleCommand(fog)
    end
end

AddPrefabPostInit("world",
    function(inst)
        inst:ListenForEvent("playeractivated",
            function(inst, data)
                if data == GLOBAL.ThePlayer
                then
            revealer()
            revealer2()
                end
            end
        )
    end
)

i use this but it doesn't work for server i need it to work for dedicated server it works just fine in self hosted please help

Edited by Dezcoo

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...