|
| 17 Feb 2016 12:55 AM |
So... my game that I'm CURRENTLY working on calls for keeping a lardton of doors in a table or array so that they can all be individually accessed later by the server.
IE: Player clicks on a door> Door's script calls modulescript> Modulescript finds said door> Door opens/closes.
How do I make it into a list or something for the script to go through? I know it's possible but I've looked everywhere and can't figure it out myself. I've talked to some other FE scripters and scripters in general, and one of them told me it just plain can't be done...
As for Filtering Enabled, I'm getting a grip on that and figuring it out. Of course I will more than likely need help in the future. My problem is that whilst there are tons and tons of forums and such available to teach myself, I find it far easier to be taught through example and visuals, with someone not necessarily giving me the answers but kind of giving a push to the right direction. A tutor, sort of.
Other than this problem, development for the game is going alright... but it's just started. So. I'll try to stay posted here until the most complicated stuff is tended to- and for all's holy sake... please be nice to each other down there. - _ - |
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 01:00 AM |
| Why not just tell the script what door to open at the same time you tell it what player clicked it? |
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 01:04 AM |
| You mean kind of like an ontouched property where it tags the player? Hmn... I've thought of that... I'll talk to friend and see how that plays out. - _ - I'm not a pro at FE and module scripting is completely new to me, having been away from coding period, I'm extremely rusty. Like... ridiculous rusty. It feels shameful really. |
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 01:05 AM |
No why would you use on touched?
I'm saying when you tell the server "Hey you need to look for this door" Why not tell it the door instead of telling it to look for it? |
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 01:07 AM |
Because with a normal (or local) script, the door seems to only work in Studio mode doing that. With a simple click the door and it opens thing going on. This would not at all be a problem if Filtering Enabled wasn't involved, but exploiters love trashing games so... yeah. B (
I'm hoping this is what you mean, because else I'm confused. |
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 01:13 AM |
No I'm not saying open the door with the local script
I'm saying have the local script tell the server script to open the door
Thats how people make things work with filteringEnabled, they just have to send data to a server script and have the server script do all the stuff. |
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 01:20 AM |
| Okay so how does it identify the door? That's my problem. I can easily get the scripts to work, my problem is that I don't know how to link the door to the module script, let alone multiple doors. |
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 01:28 AM |
Local Script (In the door) [ local Module = require(game.Workspace.ModuleScript) script.Parent.ClickDetector.MouseClick:connect(function(Click) Module.OnClicked() end) ]
Module Script (In the Workspace) [local module = {} function module.OnClicked()
local isOn = true local Door = {}
function on() isOn = true Door.Transparency = 0 Door.CanCollide = true end
function off() isOn = false Door.Transparency = 0.6 Door.CanCollide = false end
local function Click()
if isOn == true then off() else on() end
end
Door.ClickDetector.MouseClick:connect(Click)
on()
end return module]
Now I mean I'm already well aware I'm doing something horribly wrong here. - _ - Being used to scripting without FE, and once again, being rusty, this scripting makes me cringe, but I just can't tell why. |
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 01:30 AM |
| What are you trying to use the module for...? |
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 01:37 AM |
Okay... I originally scripted each individual door with the same script in the Module, a slightly altered version anyway. Upon playing in Studio, they worked fine. When I went into a public server, doors don't work.
I decided "Well, maybe I can do it through module script" after some light research, and so far, doors don't work.
I had hoped that, since client must talk to server, server must evaluate and return profit, that the Local script from the door in the workspace talking to the Module script in the workspace would handle this... or so I was told. - _ -
Clearly you see how that worked out. It's more frustrating because no errors appear in the Output, or Script Analysis. So I'm left with literally nothing to go on except my own rust and lack of FE know how.
This is made far worse because most people on the forums do one of two things... either tell me and many people like me that I'm "Trash and should lern-2-scrypt" despite that I'm here because I know how to script and need some help with it, or leave links to the pages I've already looked at, which is far more infuriating in all honesty. B l |
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 01:37 AM |
| Forget the module and use a remote event. |
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 01:39 AM |
| Alright... thanks... time to do more research. - n - |
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 01:44 AM |
| http://www.roblox.com/item.aspx?id=365001819 |
|
|
| Report Abuse |
|
|