OnPlayerChangeDimension: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Event|Server|1.2.2}} {{FuncDescription|Event called when a player instance changes dimensions from SetPlayerDimension.}} {{FuncSyntax|OnPlayerChangeDimension(obje..." |
No edit summary |
||
Line 3: | Line 3: | ||
{{FuncDescription|Event called when a player instance changes dimensions from [[SetPlayerDimension]].}} | {{FuncDescription|Event called when a player instance changes dimensions from [[SetPlayerDimension]].}} | ||
{{FuncSyntax|OnPlayerChangeDimension( | {{FuncSyntax|OnPlayerChangeDimension(player, old_dimension, new_dimension)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam| | {{FuncParam|player|The player which changed dimension.}} | ||
{{FuncParam|old_dimension|The old dimension.}} | {{FuncParam|old_dimension|The old dimension.}} | ||
{{FuncParam|new_dimension|The new dimension.}} | {{FuncParam|new_dimension|The new dimension.}} | ||
Line 12: | Line 12: | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | <syntaxhighlight lang="Lua"> | ||
AddEvent(" | AddEvent("OnPlayerChangeDimension", function(player, old_dimension, new_dimension) | ||
print(" | print("Player "..player.." changed dimensions") | ||
end) | end) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{ | {{PlayerServerEvents}} |
Latest revision as of 10:09, 19 September 2020
Description
Event called when a player instance changes dimensions from SetPlayerDimension.
Syntax
OnPlayerChangeDimension(player, old_dimension, new_dimension)
Parameters
- player
The player which changed dimension. - old_dimension
The old dimension. - new_dimension
The new dimension.
Example
AddEvent("OnPlayerChangeDimension", function(player, old_dimension, new_dimension)
print("Player "..player.." changed dimensions")
end)