Author Topic: Any one ever notice how Lua help in FP works?  (Read 2855 times)

0 Members and 1 Guest are viewing this topic.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Any one ever notice how Lua help in FP works?
« on: July 06, 2007, 03:13:17 PM »
Noob posts:
Quote
Hey guys, what's wrong with my code?
Code: [Select]
for i,1 maxplayers do
curtime = myvariable
end

Lua expert posts:
Quote
Dude, that's terrible. Do it like this:
Code: [Select]
For i,1 MaxPayers do
CurTime = MySuperTable[i] = 2 * (const*5)
return loop false;
end;


Another expert posts:
Quote
You guys are so stupid, watch and learn, noobs.
Code: [Select]
GDPTLastPos = {}
GDPTLastPart = {}
GDPTParticle = {}

GDParticleTimes = 0.02

for k,v in pairs(player.GetAll()) do
GDPTLastPos[v] = Vector(0,0,0)
GDPTLastPart[v] = 0
GDPTParticle[v] = nil
end

function GDDecipher(ply, command, argv, args)
if #argv < 1 then
ULib.tsay( ply, ulx.LOW_ARGS )
return
end

local matpassed = nil
if argv == "fire" then matpassed = "gd_fire" end
if argv == "bluefire" then matpassed = "gd_blueflame" end
if argv == "plasmablue" then matpassed = "gd_plasmablue" end
if argv == "plasmared" then matpassed = "gd_plasmared" end
if argv == "plasmagreen" then matpassed = "gd_plasmagreen" end
if argv == "plasmateal" then argvpassed = "gd_plasmateal" end
if argv == "plasmapurple" then matpassed = "gd_plasmapurple" end
if argv == "bloodblue" then matpassed = "gd_bloodblue" end
if argv == "bloodred" then matpassed = "gd_bloodred" end
if argv == "bloodgreen" then matpassed = "gd_bloodgreen" end
if argv == "bloodteal" then matpassed = "gd_bloodteal" end
if argv == "bloodpurple" then matpassed = "gd_bloodpurple" end
if argv == "ring" then matpassed = "gd_ring" end
if argv == "whiteshine" then matpassed = "gd_whitelight" end
if argv == "striderball" then matpassed = "gd_strider" end
if argv == "beam" then matpassed = "gd_beam" end
if argv == "flash" then matpassed = "gd_flash" end
if argv == "plasmarainbow" then matpassed = "gd_plasmaall" end
if argv == "bloodrainbow" then matpassed = "gd_bloodall" end
if argv == "light" then matpassed = "gd_light" end
if argv == "none" then GDParticle[ply] = nil end

GDParticle[ply] = matpassed
end





function GDParticleDraw()
for k,v in pairs(player.GetAll()) do
Msg(GDPTParticle[v])
if GDParticle[v] == nil then return;end
if GDPTLastPos[v] ~= v:GetPos() then
if GDPTLastPart[v] + GDParticleTimes < CurTime() then
  local effectdata = EffectData()
  effectdata:SetStart(v:GetPos())
  effectdata:SetOrigin(v:GetPos())
  effectdata:SetScale( 1 )
  util.Effect( GDPTParticle[v], effectdata )
GDPTLastPos[v] = v:GetPos()
GDPTLastPart[v] = CurTime()
end
end
end
end
hook.Add( "Think", "GD Part Think", GDParticleDraw )
ulx.concommand( "trail", GDDecipher, "<choice> - Gives you a particle trail.", ULib.ACCESS_ALL )
ulx.concommand( "trailhelp", GDHelp, "- Displays all valid particles you can use.", ULib.ACCESS_ALL )

Noob replies:
Quote
Um.. what?


Offline spbogie

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: 41
I have not failed. I've just found 10,000 ways that won't work. - Thomas A. Edison
I reject your reality and substitute my own. - Adam Savage

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Any one ever notice how Lua help in FP works?
« Reply #2 on: July 07, 2007, 10:47:29 AM »
Haha, thats perfect.