Skip to content

Networking Functions

Functions interacting with the game's networking layer and objects.


fireclickdetector

Fires a ClickDetector on any instance.

Lua
fireclickdetector(instance)

Parameters: - instance (Instance): Instance with ClickDetector

Example:

Lua
1
2
3
4
local part = game["Environment"]:FindChild("ClickPart")
if part and part:FindChild("ClickDetector") then
    fireclickdetector(part)
end


NetMessage (Singleton)

Used for creating networking packets to send to the server.

Lua
1
2
3
4
5
6
7
local msg = NetMessage.New()
msg:AddString('type', 'Status')
msg:AddString('Status', "Hello from PolyHack")
msg:AddInt('MaxCustomers', 9999999)

-- Invoke on a NetworkEvent
game["Environment"]["Tycoon 1"]["NetworkEvent"]:InvokeServer(msg)