Player onuse

From Fortress Forever Wiki
Revision as of 16:10, 30 March 2015 by R00Ki3 (talk | contribs) (Created page with "This callback is called whenever the player presses the ''USE'' button. ==Usage== <pre> function player_onuse( player ) local MyName = player:GetName() -- Says the p...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This callback is called whenever the player presses the USE button.

Usage

function player_onuse( player )
    local MyName = player:GetName()

    -- Says the players name on use.
    ChatToPlayer(player, "My Name is "..MyName.."!")
end

Return false to prevent the use from happening.