Hello. I tried to make an effect scripts for pointshop hats However, It doesn't works....What is the point of I need to modify?
[lua]ITEM.Name = "#1 beerhat234"
ITEM.Enabled = true
ITEM.Description = "Gives you a The #1 beerhat."
ITEM.Cost = 10000
ITEM.Model = "models/gmod_tower/drinkcap.mdl"
ITEM.Attachment = "eyes"
ITEM.Functions = {
OnGive = function(ply, item)
ply:PS_AddHat(item)
end,
OnTake = function(ply, item)
ply:PS_RemoveHat(item)
end,
ModifyHat = function(ent, pos, ang)
ent:SetModelScale(Vector(1.5, 1.5, 1.5))
pos = pos + (ang:Forward() * -2.8) + (ang:Up() * 3)
ang:RotateAroundAxis(ang:Right(), 20)
return ent, pos, ang
end
}
EFFECT.ANG = Material("particle/flameThrowerFire/flamethrowerfire128.vtf")
function EFFECT:Render()
local startPos = Vector(0,0,0)
local endPos = Vector(100, 100, 100)
local width = 10
local color = Color(255, 0, 0)
render.SetMaterial(self.ANG)
render.DrawBeam(startPos,
endPos,
width,
0,
0,
color)
end
[/lua]
anyone?
If it doesn't work it means it's either 1. Erroring, in which case look in the console for an error and tell us it. Or 2. The positioning is off, so you can't see it.
Sorry, you need to Log In to post a reply to this thread.