i want to fire from module script(serverScriptService) to server script that placed in model.
the fire event placed in the middle of the module script code and i want only the event fire part to work.
please help me.
i want to fire from module script(serverScriptService) to server script that placed in model.
the fire event placed in the middle of the module script code and i want only the event fire part to work.
please help me.
Canât seem to understand, elaborate please. Are you trying to run a RemoteEvent from a ModuleScript called by a ServerScript?
But, here is some explanation: ModuleScripts act depending on the type of script they are being called by; this means that if you can an ModuleScript from an LocalScript, the code in the module will be ran client-sided, and vice-versa with a ServerScript.
i am tying to run bindable event from a module script to ServerScript that placed in: game.workspace.Model
And whatâs the issue? Whatâs the code youâre using to do that?
i am trying to get the name of the random and then instance new click detector to the clone part of the destroyed part in the second model
Read up on events documentation: Events | Documentation - Roblox Creator Hub
I would generally avoid using bindables unless you absoluetely need to, all of this can be achieved with modules.
I never really used BindableEvents, nor BindableFunctions, but I canât seem to find an issue with the code either. Mind telling if thereâs any errors given by the Output?
there is no errors, just the instance not working
you know what i have other question. how can i get the name of the random part. and then put the name in other script and then: if i have the name of the part then i can search in the model the same name and do instance.new click detector
Your script is placed under ReplicatedStorage
Similar to serverstorage, scripts in Rep storage donât fire. You need to put the script into serverscriptservice!
You can find out more on the rep storage here
i need to instance new click detector to the model and this need to happend only after the round started and the model(map) cloned to game.workspace
Then keep the script disabled until it gets cloned into workspace.
still not working. i donât have any errors just nothing happening only the script changed to enabled
Try having a part with the exact same script enabled on Workspace. See if it fires by having it print something.
i tried putting the script that was in the duplicated model to the workspace and i found that in the workspace its working, but when i put it back its not working and no errors
Have it print what the randomitemremove is.
So above the if statement, make it say print(name)
If it prints nothing, then problem is you not defining bindable/ its location. So thatâs why itâs not firing.
If it says canât print nil, then that means you didnât define it right in the modulescript.
Oh, on that case, ignore my above message. Thatâs a problem with disabling/ enabling your script.
Have the script check that itâs a descendant of workspace first, before it does any event firing.
Keep it disabled until it becomes a member of workspace. Then enable it, and have it print(âThis script is in workspaceâ)
but my script need to be in that model(inside the model)
i need to set it disabled and when the model cloned to the workspace and then enable the script that inside the model?
Yes. When itâs inside the model it needs to be disabled since youâve set what event is in the script.
After it gets cloned and placed inside the workspace, you set it to enabled so it has time to load in first.
See if that does anything to help. If not, I suggest having one script in workspace, that controls everything, rather than constantly cloning new ones.