hook.Add("KeyPress", "keypress_lightning", function(ply,key)
if ( key == IN_USE ) then
local vPoint = Vector( 783.065430, 149.839584, -79.968750 )
local effectdata = EffectData()
effectdata:SetOrigin( vPoint )
util.Effect( "TeslaZap", effectdata )
print("it's working!")
end
end)
Message prints in console but no lightning, Other effects in place of "TeslaZap" work just fine. Are there parameters I'm missing or is there another function I need to apply to effectdata?
New code, still not rendering?
hook.Add("KeyPress", "keypress_lightning", function(ply,key)
if ( key == IN_USE ) then
local bPoint = Vector( 1436.101563, 263.769836, -79.968750 )
local aPoint = Vector( 1425.327393, -131.511093, -79.968750 )
local effectdata = EffectData()
effectdata:SetOrigin( bPoint )
effectdata:SetStart( aPoint )
effectdata:SetScale(1)
effectdata:SetMagnitude(5)
util.Effect( "TeslaZap", effectdata )
print("it's working")
end
end)
You have to apply it to an entity.
Sorry, you need to Log In to post a reply to this thread.