Grimshackles Posted July 27, 2024 Share Posted July 27, 2024 (edited) 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 July 27, 2024 by Dezcoo Link to comment https://forums.kleientertainment.com/forums/topic/158713-need-help-with-script-global-player-for-server/ Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now