Main/resources/[Developer]/[Max]/Duck_Troll/client.lua
2025-06-13 21:12:14 +02:00

33 lines
890 B
Lua
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

RegisterNetEvent("troll:verwandelnZurRatte", function()
local ratModel = GetHashKey("a_c_rat")
local defaultModel = GetHashKey("mp_m_freemode_01")
-- Rattenmodell laden
RequestModel(ratModel)
while not HasModelLoaded(ratModel) do Wait(50) end
SetPlayerModel(PlayerId(), ratModel)
SetModelAsNoLongerNeeded(ratModel)
lib.notify({
title = 'Troll aktiv',
description = 'Du bist jetzt eine Ratte 🐀 für 60 Sekunden!',
type = 'inform'
})
-- 60 Sekunden warten
Wait(60000)
-- Zurückverwandeln
RequestModel(defaultModel)
while not HasModelLoaded(defaultModel) do Wait(50) end
SetPlayerModel(PlayerId(), defaultModel)
SetModelAsNoLongerNeeded(defaultModel)
lib.notify({
title = 'Zurückverwandelt',
description = 'Du bist wieder normal.',
type = 'success'
})
end)