๐ฎ Steam
Interact with Steam APIs.
๐ฟย Static Functionsโ
| Returns | Name | Description | |
|---|---|---|---|
| string or nil | GetJoinedFromFriend | Gets the SteamID of the Friend whose invite or "Join Game" brought this player to the current server | |
| boolean | InviteFriend | Invites a Steam Friend to the current server | |
OpenInviteDialog | Opens the Steam Overlay invite dialog, so the player can invite Friends to the current server | ||
SetRichPresence | Sets Steam Rich Presence text | ||
TriggerScreenshot | Triggers a Steam screenshot |
Optimal

GetJoinedFromFriendโ
Gets the SteamID of the Friend whose invite or "Join Game" brought this player to the current server, ornilif they connected any other way.
This value is reported by the client, so a server should not trust it blindly (e.g. ask the Friend to accept before adding the player to a private group).
local ret = Steam.GetJoinedFromFriend()
Steam.GetJoinedFromFriend Examples
Puts a player in the party of the Friend who invited them
-- Client side
local function JoinFriendParty(friend_steam_id)
Events.CallRemote("JoinFriendParty", friend_steam_id)
end
-- If we connected through an invite or "Join Game"
local friend_steam_id = Steam.GetJoinedFromFriend()
if (friend_steam_id) then
JoinFriendParty(friend_steam_id)
end
-- If we accepted an invite to the server we are already on
Steam.Subscribe("FriendJoin", JoinFriendParty)
-- Server side
Events.SubscribeRemote("JoinFriendParty", function(player, friend_steam_id)
for _, other in pairs(Player.GetAll()) do
if (other:GetSteamID() == friend_steam_id) then
-- Adds player to other's party
break
end
end
end)
Optimal

InviteFriendโ
Invites a Steam Friend to the current server
local ret = Steam.InviteFriend(steam_id)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | steam_id | Required parameter | The SteamID of the Friend to invite |
Returns
| Type | Description |
|---|---|
| boolean | If the invite was sent |
Optimal

OpenInviteDialogโ
Opens the Steam Overlay invite dialog, so the player can invite Friends to the current server.
When a Friend accepts, they join this server andSteam.GetJoinedFromFriend()returns this player's SteamID on their side. If they were already on this server, theFriendJoinevent is called instead
Steam.OpenInviteDialog()
Optimal

SetRichPresenceโ
Sets Steam Rich Presence text
Steam.SetRichPresence(text)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| string | text | Required parameter | The new Steam Rich Presence text |
Optimal

TriggerScreenshotโ
Triggers a Steam screenshot
Steam.TriggerScreenshot()
๐ย Eventsโ
| Name | Description | |
|---|---|---|
FriendJoin | Called when this player accepts a Friend's invite or "Join Game" to the server they are already on |

FriendJoinโ
Called when this player accepts a Friend's invite or "Join Game" to the server they are already on. In this case the player does not reconnect.
When the player connects from another server or from the menus, useSteam.GetJoinedFromFriend()instead.
Steam.Subscribe("FriendJoin", function(friend_steam_id)
-- FriendJoin was called
end)
Arguments
| Type | Argument | Description |
|---|---|---|
| string | friend_steam_id | The SteamID of the Friend |
