Closed Mista-Tea closed 6 years ago
I think it needs to use http://wiki.garrysmod.com/page/duplicator/RegisterEntityClass so that it's not using the generic duplicator function.
scripted ents need to register their duplicator function or the generic duplicator function is used which only works if the scripted ent is spawnable.
I think you should copy this to garrysmod-issues. It's not an advdupe2 issue.
Thanks for the quick response and for looking into this. I'll try to follow up with garrysmod-issues.
Trying to spawn in a prop_effect while not in the admin/superadmin user group will block the effect.
https://github.com/wiremod/advdupe2/blob/0aa25c3706c209bd12520273bf740e6b05b2528a/lua/advdupe2/sv_clipboard.lua#L784-L793
if !duplicator.IsAllowed(Class) then return false end
passesif ( !scripted_ents.GetMember( Class, "Spawnable" ) and not EntityClass ) then return false end
does not pass, as prop_effects haveSpawnable
asfalse
and EntityClass is nil.I discovered even the built-in Duplicator tool uses roughly the same logic (advdupe2 most likely modeled after it) and blocks non-admins from spawning effects: https://github.com/Facepunch/garrysmod/blob/394ae745df8f8f353ea33c8780f012fc000f4f56/garrysmod/lua/includes/modules/duplicator.lua#L419-L424
Perhaps I should be asking this on the GMod repo instead, but what is the reasoning to block effects?
How are we supposed to allow players to dupe and spawn effects without turning everyone into an admin? I can modify the base gamemode's prop_effect.lua file and set
ENT.Spawnable = true
, but this seems like a poor workaround with potential consequences I haven't seen yet.