1. Post #1
    Gold Member
    ExtReMLapin's Avatar
    February 2012
    564 Posts
    Hello , when i try to use "SetNWBool" and "GetNWBool" it doesnt works

    The code


    Serverside :

    function cloak()
    
       for k,v in pairs(player.GetAll()) do
    if  v:GetNWBool("Cloak") == true then
    v:SetNWBool("Cloaked",true)
    v:SetMaterial("effects/strider_bulge_dudv")
    v:SetWalkSpeed(250)
    v:SetRunSpeed(500)
    v:DrawShadow(false)
    
    v:DrawWorldModel(false)
    v:SetNoTarget(true)
    v:SetJumpPower(200)
    
    
    
    end
    end
    end
    



    ClientSide :

    
     for k,v in pairs(player.GetAll()) do
    		if ( slots[selected] )  and (  slots[selected].name ) == "Cloak"  then  
    v:SetNWBool("Strenght",false)
    v:SetNWBool("Armor",false)
    v:SetNWBool("Speed",false)
    v:SetNWBool("Cloak",true)
    RunConsoleCommand( "play", "suit/cloak.mp3" )
    
    end
    end
    
    


    i tried to remplace
    if  v:GetNWBool("Cloak") == true then
    


    to

    if  (v:GetNWBool("Cloaked",true)) then
    

  2. Post #2
    "The superior man understands what is right; the inferior man understands what will sell"
    Chessnut's Avatar
    August 2011
    3,538 Posts
    You cannot set networked variables clientside, it is just a usermessage. If you want to network your variable, you can use datastream (which is removed in GM13) or console commands.
    Reply With Quote Edit / Delete Reply United States Show Events Informative Informative x 1 (list)

  3. Post #3

    July 2007
    864 Posts
    "Cloak" and "Cloaked" isn't the same word.

    Edited:

    By that i mean try this:

    if( v:GetNWBool("Cloaked") == true )then

  4. Post #4
    Gold Member
    ExtReMLapin's Avatar
    February 2012
    564 Posts
    You cannot set networked variables clientside, it is just a usermessage. If you want to network your variable, you can use datastream (which is removed in GM13) or console commands.
    Ok thanks