So I've recently tried to activate a lighting change from an onTouch event This is the script: function onTouch(part)
game.Workspace.ExposureCompensation = 2
end
script.Parent.Touched:connect(onTouch)
The only problem is that once I spawn in ExposureCompensation is already set to two, meaning it's already activating the script without me touching the block.
https://gyazo.com/cb6835b64879aa82caff7f56a9b5a70f
You are not checking if it's an actual body part of a player's character. So it could be the baseplate touching it, and firing it immediately.
Simply check that it's a player touching it.
```lua local Players, Workspace = game:GetService("Players"), game:GetService("Workspace");
script.Parent.Touched:Connect(function(part) --// pls use :Connect, :connect is deprecated local client = Players:GetPlayerFromCharacter(part.Parent);
if (client) then Workspace.ExposureCompensation = 2; end
end); ```
If a player touched it, set ExposureCompensation
to 2
.
In the gif you provided, you did not indent your code. Even if it's just one line, always indent your code. It makes code more readable, and makes it easier for debugging.