Hello! I have two copies of a very simple script with only a few variables changed. One works as expected, but for some reason the other one outputs “The current thread cannot use ‘ToggleLight’ (lacking capability Unassigned)”. I’ve never encountered this before and any topics that i’ve found on this error were dealing with module scripts.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ToggleLight = ReplicatedStorage.RemoteEvents.ToggleLight
local lamp = script.Parent.Lamp
local light = script.Parent.Bulb.PointLight
lamp.ClickDetector.MouseClick:Connect(function(player)
ToggleLight:FireClient(player, light, lamp.Click)
end)
Basically what happened is that Roblox added a feature to limit the capabilities of scripts because they have the potential of being harmful. Especially if you’re using scripts from the toolbox which have been know to have backdoors and other harmful pieces of code.
I have encountered this issue with a package i’ve took which was “Replica” by loleris. I assume due to these packages, modules and scripts sandbox feature being enabled in default, it causes some strict limitiations for you to do something you have to. Imo, this sandbox feature shouldn’t be on the packages or any of the scripts by default else it would be hard to manage the sandbox feature for all of the scripts you have which.. i don’t really like at all.
It absolutely should default to being enabled even on models that are just scripts because it forces developers to then actually question what permissions that code actually needs in order to function. Forcing developers to be more safety-conscious is better than convenience and complacency.
That is right, but every new scripter is not aware of that which even i got confused because the feature just got released out of nowhere. I haven’t even seen anything related to this feature and this will most likely lead new scripters to be confused, They should have notified about that, correct me if i am wrong, i figured this out by myself. I don’t think i should be spending time to fix this instead of scripting(if i specifically want to customize it, i could just enable the feature through workspace and do it.)