• Use script help
    1 replies, posted
Hi there, I'm making a gamemode, which involves npcs a fair amount, so I need a script to work, however it's not working right because it isn't detecting else wise. Can someone please help? [code] function GM:PlayerUse(ply,entity) usedClass=entity:GetClass() if(usedClass=="npc_citizen") then owner=entity:GetOwner() if(owner==ply) then ply:SetNWEntity("talkingTo",entity) RunConsoleCommand("drawTalk") ply:ChatPrint("Works!") return true end else ply:ChatPrint("You don't know him...") end end if(usedClass=="prop_door_rotating") then return false end if(usedClass=="func_door_rotating") then return false end [/code]
[lua]function GM:PlayerUse(ply,entity) usedClass=entity:GetClass() if(usedClass=="npc_citizen") then owner=entity:GetOwner() if(owner==ply) then ply:SetNWEntity("talkingTo",entity) RunConsoleCommand("drawTalk") ply:ChatPrint("Works!") return true else ply:ChatPrint("You don't know him...") end end if(usedClass=="prop_door_rotating") then return false end if(usedClass=="func_door_rotating") then return false end end[/lua] Fixed
Sorry, you need to Log In to post a reply to this thread.