Skip to content

Hook Tutorial Solution

its-suun edited this page Aug 19, 2017 · 1 revision
--@name Hook Tutorial Solution
--@server
local i = 0
hook.add("PlayerEnteredVehicle", "print", function(ply, vehicle)
    print(tostring(ply) .. " entered " .. tostring(vehicle))
    
    i = i + 1
    if i == 5 then
        hook.remove("PlayerEnteredVehicle", "print")
    end
end)
Clone this wiki locally