• Help with pointshop
    41 replies, posted
-snip-
-snip-
function ITEM:OnEquip(ply, modifications) if ply:Team() ~= "TEAM_HUMAN" then return end if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(1, function() ply:SetModel(self.Model) end) end like this ?
Yes; that's assuming the Zombie Survival human team is called TEAM_HUMAN.
[QUOTE=code_gs;44984391]Yes; that's assuming the Zombie Survival human team is called TEAM_HUMAN.[/QUOTE] how do i make it so you cant drop the swep? [editline]3rd June 2014[/editline] [QUOTE=code_gs;44983925]In the item files, add this to the OnEquip function. [code]if ply:Team() ~= "TEAM_HUMAN" then return end[/code][/QUOTE] it worked but then there a zombie it stays
Add this above the other line. [code]if ply:Team() == "TEAM_ZOMBIE" then ply:SetModel("models/whatever_the_zombie_model_is.mdl") end[/code]
[QUOTE=code_gs;44984791]Add this above the other line. [code]if ply:Team() == "TEAM_ZOMBIE" then ply:SetModel("models/whatever_the_zombie_model_is.mdl") end[/code][/QUOTE] theres different model for each class of zombie though D:
[QUOTE=log404;44984829]theres different model for each class of zombie though D:[/QUOTE] Then find the method to retrieve specific zombie classes; I'm not familiar with Zombie survival teams.
[QUOTE=code_gs;44984791]Add this above the other line. [code]if ply:Team() == "TEAM_ZOMBIE" then ply:SetModel("models/whatever_the_zombie_model_is.mdl") end[/code][/QUOTE] [QUOTE] if ply:Team() ~= "TEAM_HUMAN" then return end [/QUOTE] is this right or wrong
That's right; keep that line there.
[QUOTE=code_gs;44984879]That's right; keep that line there.[/QUOTE] how do i make it so if your a zombie then dont apply effects?
[QUOTE=log404;44984947]how do i make it so if your a zombie then dont apply effects?[/QUOTE] if ply:Team() == "TEAM_ZOMBIE" then ply:SetModel("models/whatever_the_zombie_model_is.mdl") end
[QUOTE=nettsam;44984951]if ply:Team() == "TEAM_ZOMBIE" then ply:SetModel("models/whatever_the_zombie_model_is.mdl") end[/QUOTE] if ply:Team() == "TEAM_ZOMBIE" then right here can i make it not do anything?
[QUOTE=log404;44985023]if ply:Team() == "TEAM_ZOMBIE" then right here can i make it not do anything?[/QUOTE] No; you said yourself that the old model was persisting. If you want the zombies who equipped the model as a human to use the zombie model, then you have to do a SetModel.
[QUOTE=code_gs;44985039]No; you said yourself that the old model was persisting. If you want the zombies who equipped the model as a human to use the zombie model, then you have to do a SetModel.[/QUOTE] You're comparing a number to a string. Player:Team() returns the team's id.
[QUOTE=brandonj4;44986374]You're comparing a number to a string. Player:Team() returns the team's id.[/QUOTE] Fuck how did I miss that
If ply:Team == "TEAM_HUMAN" then return else if ply:Team == "TEAM_ZOMBIE" then do nothing end Will that work?
[QUOTE=log404;44992599]If ply:Team == "TEAM_HUMAN" then return else if ply:Team == "TEAM_ZOMBIE" then do nothing end Will that work?[/QUOTE] [code] if ply:Team() == TEAM_HUMAN then -- code here end [/code] The last part is not needed.
[QUOTE=Mors Quaedam;44992633][code] if ply:Team() == TEAM_HUMAN then -- code here end [/code] The last part is not needed.[/QUOTE] Ok but how do i make it not apply to Team _ ZOMBIE
[QUOTE=log404;44994729]Ok but how do i make it not apply to Team _ ZOMBIE[/QUOTE] It shouldn't; the gamemode should set the zombie model over the pointshop model since it only applies to TEAM_HUMAN.
[QUOTE=code_gs;44994736]It shouldn't; the gamemode should set the zombie model over the pointshop model since it only applies to TEAM_HUMAN.[/QUOTE] It doesnt the gamemode loads first
[QUOTE=log404;44994765]It doesnt the gamemode loads first[/QUOTE] That's a gamemode issue then; can you post your Pointshop code?
[code]ITEM.Name = 'Zoey' ITEM.Price = 40000 ITEM.Model = 'models/player/zoey.mdl' function ITEM:OnEquip(ply, modifications) if ply:Team() ~= "TEAM_HUMAN" then return end if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(1, function() ply:SetModel(self.Model) end) end function ITEM:OnHolster(ply) if ply._OldModel then ply:SetModel(ply._OldModel) end end function ITEM:PlayerSetModel(ply) ply:SetModel(self.Model) end [/code]
Use Mors' code.
[code] ITEM.Name = 'Zoey' ITEM.Price = 40000 ITEM.Model = 'models/player/zoey.mdl' function ITEM:OnEquip(ply, modifications) if ply:Team() ~= "TEAM_HUMAN" then return if not ply._OldModel then ply._OldModel = ply:GetModel() end timer.Simple(1, function() ply:SetModel(self.Model) end) end end function ITEM:OnHolster(ply) if ply._OldModel then ply:SetModel(ply._OldModel) end end function ITEM:PlayerSetModel(ply) ply:SetModel(self.Model) end [/code] Errored out with [code] [ERROR] addons/pointshop-master/lua/items/playermodels/zoey.lua:7: unexpected symbol near 'if' 1. unknown - addons/pointshop-master/lua/items/playermodels/zoey.lua:0 [/code]
Read my last post.
[QUOTE=code_gs;44994889]Read my last post.[/QUOTE] Thats the code ...
Your code still says if ply:Team() ~= "TEAM_HUMAN" then return even though that's not what Mors' posted.
[ERROR] addons/pointshop-master/lua/items/playermodels/zoey.lua:7: unexpected symbol near 'if' 1. unknown - addons/pointshop-master/lua/items/playermodels/zoey.lua:0
..... Are you listening to what they're saying?
Sorry, you need to Log In to post a reply to this thread.