This is a simplified, community-compiled documentation for Gorilla Tag custom map Luau scripting. All logic must be written in Luau and assigned via the Custom Gamemode TextAsset field in Unity.
function OnGameStart()
function OnGameStart()
print("Game has started!")
end
function OnGameEnd()
function OnGameEnd()
print("Game over!")
end
function tick(dt)
function tick(dt)
timer = timer + dt
if timer > 5 then
print("5 seconds passed!")
timer = 0
end
end
function OnPlayerJoin(player)
function OnPlayerJoin(player)
player:SendMessage("Welcome, " .. player.name .. "!")
end
function OnPlayerTagged(victim, tagger)
function OnPlayerTagged(victim, tagger)
tagger:SendMessage("You tagged someone!")
end
emitEvent(tag: string, data: table)
emitEvent("buttonPressed", { who = player.name })
function onEvent(tag, data)
emitEvent or triggered by map interactions.function onEvent(tag, data)
if tag == "buttonPressed" then
print(data.who .. " pressed a button")
end
end
player:SendMessage(text: string)
player:SendMessage("You got a point!")
player.position
if player.position.y > 10 then
player:SendMessage("You climbed high!")
end
findGameObject(name: string)
local obj = findGameObject("FloppaButton")
if obj then obj:setVisibility(false) end
gameObject:setVisibility(true/false)
gameObject:setVisibility(true)
gameObject:setCollision(true/false)
gameObject:setCollision(false)
playSound(index: number, position: Vector3, volume: number)
playSound(1, player.position, 1.0)
onEvent("touchedGameObject", {player, gameObject})
function onEvent(tag, data)
if tag == "touchedGameObject" then
data.player:SendMessage("You touched " .. data.gameObject.name)
end
end
player:GetPersistentTable()
local data = player:GetPersistentTable() data.coins = (data.coins or 0) + 10
player:GetPlayerID()
local id = player:GetPlayerID()
print("Player ID:", id)
player:SetPersistentTable(table)
player:SetPersistentTable({ coins = 100, level = 2 })
Ban players by their ID using a manual list
local bannedIDs = {
["playerid123"] = true,
["playerid456"] = true
}
function OnPlayerJoin(player)
local id = player:GetPlayerID()
if bannedIDs[id] then
return
end
end
Give special items only to specific players
local specialIDs = {
["devplayer001"] = true
}
function OnPlayerJoin(player)
local id = player:GetPlayerID()
local specialItem = findGameObject("GoldenBanana")
if specialIDs[id] and specialItem then
specialItem:setVisibility(true)
specialItem:setCollision(true)
else
if specialItem then
specialItem:setVisibility(false)
specialItem:setCollision(false)
end
end
end
print(...) to log info to the Unity console/logcat.tick for time logic like hunger, cooldowns, or auto-income.player:GetPersistentTable() to make progress persistent across map reloads.