Talk:Console/Don't Starve Together Commands/@comment-26852192-20150803211546/@comment-173.227.249.131-20150810133732

I figured out the syntax. Here are the commands i'm using on my server. They all work beautifully.

Make all players invincible(no damage to sanity, hunger or health):

    for k,v in pairs(AllPlayers) do v.components.health:SetInvincible(true) end

Make all players vulnerable again:

    for k,v in pairs(AllPlayers) do v.components.health:SetInvincible(false) end

Set all players hunber to 100%:

    for k,v in pairs(AllPlayers) do v.components.hunger:SetPercent(1) end

Set all players sanity to 100%:

    for k,v in pairs(AllPlayers) do v.components.sanity:SetPercent(1) end

Set all players health to 100%:

    for k,v in pairs(AllPlayers) do v.components.health:SetPercent(1) end

Move all players to the cursor:

    for k,v in pairs(AllPlayers) do c_move(v) end

Respawn all players:

    for k, v in pairs(AllPlayers) do v:PushEvent('respawnfromghost') end

Set health max to specific value(1000 in the example):

    for k,v in pairs(AllPlayers) do v.components.health:SetMaxHealth(1000) end