-
Notifications
You must be signed in to change notification settings - Fork 1
Stream Functions
DizzasTeR edited this page Nov 1, 2020
·
4 revisions
- None
-
readByte() — Read data as bytes
-
readNumber() — Read data as integers/numbers
-
readFloat() — Read data as decimal/number
-
readString() — Read data as text
-
writeBtye(uint8_t data) — Write bytes into data stream
-
writeNumber(int data) — Write integer/number into data stream
-
writeFloat(float data) — Write a decimal into data stream
-
writeString(string data) — Write text into data stream
-
send(Player player / nil) — Send the stream to the player or all players if player is nil
-
clear() — Clear all the data stream
- None
- None
local player = Player.findByID(0)
if player then
player.health = 200
player:msg("Your health is now: "..player.health.."%")
else
Logger.warn("Player with id 0 not found. Total players in-game: "..Player.count())
end