How to assign parameter in modulescript from script

So this is in a modulescript:
image
so what im trying to do is im trying to set “player” parameter for the function which is from another event from server side script:
image_2024-08-03_145018200
normally you do it like: Zone1.playerEntered:Connect(function(player) end) but since im trying to get function from module i can’t do it this way and my problem is that when modulescript runs code once the “player” parameter equals to nil so it returns error.

im not doing .playerEntered in modulescript cuz it works with issues. thanks to anyone that can give some tips.

You have to either remove the calling brackets at the end:
Zone1.playerEntered:Connect(DuelModule.Plr1_Enter)
Or you can just wrap it in a function:
Zone1.playerEntered:Connect(function(player) DuelModule.Plr1_Enter(player) end)

1 Like

Thanks that works now but i was wrong about it having issues if i do it in modulescript cuz it still has issues but that has nothing to do with this so i’ll mark this as solution.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.