I am trying to create a .touched event for when someone touches a part, lighting changes such as color correction and etc. However, this seems to fire for everyone and not just the person who’s touched its’ client.
This may be a small and dumb issue that I’m probably not aware of, but I have been trying to debug this for almost an hour and I can’t seem to get it working.
This is a LocalScript.
TouchPad.Touched:Connect(function(hit)
if not debounce then
debounce = true
print("working")
if hit then
for i = 0, 1, 0.01 do
ColorCorrection.Brightness = i
wait(0.01)
end
wait(3)
game.ReplicatedStorage.ServerTransparency:FireServer()
for i = 1, 0.2, -0.01 do
ColorCorrection.Brightness = i
wait(0.01)
end
wait(1)
for i, v in pairs(Character:GetDescendants(), Character:GetChildren()) do
if v:IsA("BasePart") then
v.Transparency = 0.5
wait(0.01)
HumanoidRootPart.Transparency = 1
end
if v:IsA("Decal") then
v.Texture = ""
end
end
HumanoidRootPart.Transparency = 1
CCOutTween:Play()
SoundService.AmbientReverb = "Bathroom"
wait(120)
debounce = false
return
end
end
end)
Help is very much appreciated!