• attempt to index global 'ply' (a nil value)
    2 replies, posted
I'm working on converting some parts of a gamemode to ULX and Im stuck on a simple error. Here's what I have for it: [CODE]AddGear("[O] Puke", "Left click to puke everywhere.", false, function ( Player, Trace ) if not ply:IsUserGroup("owner") then Notify(Player, 0, 5, "Nope."); return false; end local self = Player:GetActiveWeapon(); if !IsValid( self ) then return end Player:ViewPunch( Angle( -5, 0, 0 ) ) local edata = EffectData() edata:SetStart( Player:GetPos() ) edata:SetOrigin( Player:EyePos() ) edata:SetEntity( Player ) util.Effect( "puke", edata, true, true ) end );[/CODE]
ply is never defined, change "if not ply:IsUserGroup("owner")" to "if not Player:IsUserGroup("owner")"
[code] AddGear("[O] Puke", "Left click to puke everywhere.", false, function ( Player, Trace ) if not LocalPlayer():IsUserGroup("owner") then Notify(Player, 0, 5, "Nope."); return false; end local self = Player:GetActiveWeapon(); if !IsValid( self ) then return end Player:ViewPunch( Angle( -5, 0, 0 ) ) local edata = EffectData() edata:SetStart( Player:GetPos() ) edata:SetOrigin( Player:EyePos() ) edata:SetEntity( Player ) util.Effect( "puke", edata, true, true ) end ); [/code]
Sorry, you need to Log In to post a reply to this thread.