RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"print calls back correct value but property not changing"
This could be due to a permissions issue. In Roblox, certain properties can only be changed by scripts running on the server, not by LocalScripts running on the client. The Lighting service's GlobalShadows property is one of these. If you're trying to change this property from a LocalScript, it won't work. You'll need to use a Script or ModuleScript running on the server instead. Here's an example of how you might do this using a RemoteEvent to communicate between the client and server: -- Server Script: local ReplicatedStorage = game:GetService("ReplicatedStorage") local GlobalShadowsEvent = Instance.new("RemoteEvent") GlobalShadowsEvent.Name = "GlobalShadowsEvent" GlobalShadowsEvent.Parent = ReplicatedStorage GlobalShadowsEvent.OnServerEvent:Connect(function(player, Val) game.Lighting.GlobalShadows = Val end) -- Local Script: local ReplicatedStorage = game:GetService("ReplicatedStorage") local GlobalShadowsEvent = ReplicatedStorage:WaitForChild("GlobalShadowsEvent") Tab:AddToggle({ Name = "Global Shadows", Default = true, Callback = function(Val) print("Callback function called with value: ", Val) GlobalShadowsEvent:FireServer(Val) end })