Reload key to switch pm

I’m trying to use the reload key to switch between two playermodes of the user of the swep. how do I get a toggle, key to transform the playermodel instantly?

ps. I can do the keycheck on my own

well I feel like an idiot, thanks for the help

[editline]4th September 2017[/editline]

actually im a bigger idiot then I thought and cant get the string on my own please help
entity:SetModel(“tfa_dcu_martian_manhunter”)
doesn’t work

(I actually dicided to instead have pm switch on deploy)

Model strings generally don’t look like that. You can either run

Entity:GetModel on the player to get the model, or find it inside the spawn menu and do right click -> copy to clipboard. (Make sure it’s a playermodel and not an NPC!)

Note; a valid model looks something like “models/cs_office/radio.mdl”

entity:setModel(“models/player/tfa_dcu_martian_manhunter.mdl”) doesnt work it gave me

[ERROR] addons/gpowers_rebirth_942860152/lua/weapons/gpow_martian.lua:215: attempt to index global ‘Entity’ (a function value)

  1. unknown - addons/gpowers_rebirth_942860152/lua/weapons/gpow_martian.lua:215

First of all, it’s “SetModel”. Secondly, Entity/entity isn’t defined in your code. Could you post your full function in


 tags?