Skip to content

Commit

Permalink
Update getGamemode
Browse files Browse the repository at this point in the history
  • Loading branch information
Xesau authored Sep 26, 2021
1 parent 14cf133 commit ec869b9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Scripts/sm.interop/util.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
sm.interop.util = {}

function sm.interop.util.getGamemode()
if sm.event.sendToGame('server_loadLevel', {}) then
return 'challenge'
if sm.event.sendToGame("cl_onClearConfirmButtonClick", {}) then
return "creative"
elseif sm.event.sendToGame("sv_e_setWarehouseRestrictions", {}) then
return "survival"
elseif sm.event.sendToGame("server_getLevelUuid", {}) then
return "challenge"
end

if sm.event.sendToGame('sv_killPlayer', {}) then
return 'survival'
end

return 'creative'
return "unknown"
end

function sm.interop.util.clone(value, recursionLevel, scopeIndependentFunctions)
Expand Down

0 comments on commit ec869b9

Please sign in to comment.