• [help] How booleans work
    1 replies, posted
I'm trying to create a value in a pointshop item file, that will be called in a weapon file. This is what I've got so far. item code [code]function ITEM:OnEquip(ply, modifications) ply:Fo_CreateFollower( self.Follower ) ply:SetNWBool( "crempet", true ) end[/code] weapon code [code] if ( self.Primary.Ignite ) then local tr = self.Owner:GetEyeTrace() if (self:GetNWBool( "crempet" ) == true) then return true end if (!tr.Entity) then return false end if (!tr.Entity:IsValid() ) then return false end if (!tr.Entity:IsPlayer()) then return false end if (tr.Entity:IsWorld()) then return false end if (tr.Entity:Team() == TEAM_HUMAN) then return false end if (tr.Entity:GetPos():Distance( self.Owner:GetPos() ) >= 62) then return false end if ( CLIENT ) then return true end local Time = math.random(1, 6); tr.Entity:Ignite( Time, 0 );[/code] Are booleans not server wide? Or do they only effect things in that same file. If so, what is an alternative? This dose not work by the way, if i remove the "if (self:GetNWBool( "crempet" ) == true) then return true end" then it does ignite.
It looks like you're setting the bool on the player, not the weapon. So what you'll want to have instead on line 3 of the weapon code is: [code]if (self.Owner:GetNWBool( "crempet" ) == true) then return true end[/code]
Sorry, you need to Log In to post a reply to this thread.