Sending text packets
Example Usage of SendPacket(type, packet_text)
SendPacket(type, packet_text)
-- Example 1: Sending a basic packet to simulate an action.
SendPacket(2, "action|input\n|text|hello")
-- Example 2: Wrapped in a function for multiple sends.
function sayHello()
local packetType = 2
local packetText = "action|input\n|text|hello"
SendPacket(packetType, packetText)
end
-- Call the function to execute
sayHello()
Each example demonstrates how to use SendPacket
with different contexts, ensuring the packet is constructed as "action|input\n|text|hello" to make the player say "hello".
Last updated