Closed d-kuen closed 10 years ago
You forgot delayed pasting: https://github.com/wiremod/advduplicator/blob/master/lua/autorun/server/advdupe.lua#L2055 right now, your hook will only run if you paste a small enough contraption that it doesn't turn into a delayed paste.
EDIT: Actually, maybe it would be better to run the hook from here https://github.com/wiremod/advduplicator/blob/master/lua/autorun/server/advdupe.lua#L1872
Ok I changed those 2 things. If there are any other suggestions, please send them to me. Thanks ;)
Change it from hook.Run("AdvDupe_StartPasting", AdvDupe, Player, NumOfEnts)
to hook.Run("AdvDupe_StartPasting", Player, NumOfEnts)
(remove the AdvDupe table), do the same for all hook.Runs. This is because the AdvDupe table is global anyway so we don't need to send it.
Ok, I did that now too.
I just did what you said before:
You forgot delayed pasting: https://github.com/wiremod/advduplicator/blob/master/lua/autorun/server/advdupe.lua#L2055 right now, your hook will only run if you paste a small enough contraption that it doesn't turn into a delayed paste. EDIT: Actually, maybe it would be better to run the hook from here https://github.com/wiremod/advduplicator/blob/master/lua/autorun/server/advdupe.lua#L1872
So I think this was not an error by me. I reverted it back so the StartPaste hook now only runs once in the "StartPaste" function.
When I said "Actually, maybe it would be better to run the hook from here" I meant ONLY from there.
Anyway, this looks fine now, merging
This hook gives the possibility to get the pasting player and the entity list on a very easy way. This hook fits perfectly to the already existing hook, when a player finished to paste a dupe.
I'm open for any suggestions or changes!
Thanks