After my year and a half long hiatus I decided to challenge myself by coding a game in a single week from start to finish. I've almost got the intro GUI all set up but I've come across a problem involving FilteringEnabled and RemoteEvents. I haven't coded on ROBLOX in a year in a half and I know that ROBLOX loves to update to make it impossible for me to really get back into coding like how I used to.
My server script family tree. You can see my serversided code cleverly named, "UI". Inside is a RemoteEvent. Below is my code:
script.RemoteEvent.OnServerEvent:Connect(function(plyr, scripts, val) for _,v in pairs(scripts) do scripts.Disabled = val end end)
This anonymous function is written perfectly with no errors. The "scripts" argument is a table of scripts that I send though and "val" is a Boolean.
I'm just going to post one script as an example. One of my shortest ones so it's easier for people to answer. Below is where my LocalScript is located. And the following is the code:
script.Parent.MouseButton1Click:Connect(function() script.Parent:TweenPosition(UDim2.new(.5,0,-.2,0),Enum.EasingDirection.In,Enum.EasingStyle.Back,1,false) script.Parent.Style = Enum.ButtonStyle.RobloxRoundButton workspace.UI.RemoteEvent:FireServer({script, script.Parent.Parent.Defence.LocalScript.Disabled}, true) script.Parent.Parent.Defence:TweenPosition(UDim2.new(.5,0,-.2,0),Enum.EasingDirection.In,Enum.EasingStyle.Back,1,false, function() script.Parent.Parent.OffenceD:TweenPosition(UDim2.new(.25,0,.25,0), Enum.EasingDirection.In, Enum.EasingStyle.Quad,1,false) end) end)
Since ScriptingHelpers like to squish code together, I'll explain each line by line to make it more understandable.
Now, here's where things start to become interesting. To my knowledge there should be absolutely no issue. All scripts are written cleanly and neatly tabbed for me to read, and on top of that, no errors. Absolutely none in play test and studio mode. The lines before line 4 don't fire either, but they did before I added in FireServer
. I have not coded in a while and I am unaware of all the updates ROBLOX has recently done. I'd appreciate any help at all, even if it isn't the exact answer it could help me think of more solutions!
-LordDragonZord
script.Parent.Parent.Defence.LocalScript.Disabled
It looks like you're passing a boolean in that table and it should be your script
script.Parent.Parent.Defence.LocalScript