The current thread cannot use 'ToggleLight' (lacking capability Unassigned)

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)

1 Like

Navigate to workspace and set sandboxedinstances to experimental.

Then navigate to the script lacking capabilities and ensure the sanboxed property is disabled.

You may have to start enabling capabilities if this doesnt work.

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.

2 Likes

Thank you so much!!! Looks like the lamp that i imported was sandboxed.