AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
function ENT:Initialize()
self:SetModel("models/props_junk/garbage_glassbottle003a.mdl")
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()
if phys:IsValid() then
phys:Wake()
end
end
function ENT:Use(use, ply)
local plyHealth = ply:Health()
local ignite = math.random(1,3)
local says = math.random(1,3)
print("The chance of "..ply:Nick().." of ignite was "..ignite.." of 3")
ply:SetHealth(plyHealth / 2)
self:Remove()
-- Efeito --
hook.Add("RenderScreenspaceEffects","Drunk",function()
local tab = {}
tab[ "$pp_colour_addr" ] = 0
tab[ "$pp_colour_addg" ] = 0
tab[ "$pp_colour_addb" ] = 0
tab[ "$pp_colour_brightness" ] = 8
tab[ "$pp_colour_contrast" ] = 4
tab[ "$pp_colour_mulr" ] = 0
tab[ "$pp_colour_mulg" ] = 0
tab[ "$pp_colour_mulb" ] = 0
DrawColorModify(tab)
DrawMotionBlur(1.3)
end)
if plyHealth < 15 then
ply:Kill()
end
if ignite == 2 then
ply:Ignite( 3 )
if says == 1 then
ply:Say("I'm burning inside!")
end
if says == 2 then
ply:Say("This is crazy.")
end
if says == 3 then
ply:Say("Uckckk..")
end
end
end
Basically, this is working, but, the hook's not working.
I've got some comments on my previous post, so, i studied a bit more and made this.
I need help with this, maybe i'm having a mistake and i cant see this, if you see this, tell me, plz, no hating.
RenderScreenspaceEffects doesn't working because it's clientside hook and you trying use it in serverside
Oh, thanks!
Sorry, you need to Log In to post a reply to this thread.