When I first started Lua scripting there weren't much easy to understand guides for things other than bosses, so here's a list of some useful player functions.
:SendBroadcastMessage("Your message here")
-Sends a message to the player that no one else can see. Useful for custom commands.
:DealGoldMerit(X)
-X is the amount of gold you want to add to the player.
:AdvanceAllSkills(X)
-X is the amount you want to increase all of the player's skills by.
:IsAlive()
-This checks if the player is alive.
:ResurrectPlayer()
-This resurrects the player. You can use IsAlive to make it check if the player is already alive to make this into a more advanced function.
:GetPlayerLevel()
-Checks for the player's level.
:SetPlayerLevel(X)
-Sets player level to X. You can also do a level check and make it so it increases the player level instead of just mods it.
:RepairAllPlayerItems()
-Repairs all of the player's items.
:SetScale(X)
-Sets player scale to X.
:RemoveAllAuras()
-Removes all auras, harmful and helpful, from the player. Useful for removing res sickness.
:CastSpell(X)
-Makes the player cast spell with the spell ID X. The player WILL cast it on themself.
:SavePlayer()
-Saves the player's progress.
:SetPlayerSpeed(X)
-Sets the player's speed to X. 7 is around default run speed.
:GiveHonor(X)
-Gives the player X amount of honor.
:SetPlayerWeather(X, 1)
-Sets the player's weather to weather ID X.
Those are pretty much the most useful ones. You have to put something in front of the colon to use it. EX:
function EasyCmd (event, player, message, type, language)
if (message == "*save") then
player:SavePlayer()
player:SendBroadcastMessage("Character Saved.")
return 0
end
end
This is a custom command I made so when the player types in *save, it saves their progress. return 0 is so when you type in the command it doesn't say it out loud, but it DOES still send a broadcast message to the player. To find out what you put in front of the colon, you have to match the text after the function to the text before the colon (see green text). It IS case-sensitive, but you can make them whatever you want.
Well, that's pretty much it. Thanks for reading and feel free to comment.