• Reload key to switch pm
    5 replies, posted
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
[url]https://wiki.garrysmod.com/page/Entity/SetModel[/url]
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 [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/GetModel]Entity:GetModel[/url] 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 "[B]S[/B]etModel". Secondly, Entity/entity isn't defined in your code. Could you post your full function in [code] tags?
Sorry, you need to Log In to post a reply to this thread.