Can exploiters get into different things with local script being in my game? I am really unsure. If so, I'd like some help converting these to Remote.
water on
local isOn = false function on() isOn = true script.Parent.Value.Value = 0 end function off() isOn = false script.Parent.Value.Value = 1 end function onClicked() if isOn == true then off() else on() end end script.Parent.ClickDetector.MouseClick:connect(onClicked) on()
light on
local isOn = false function on() isOn = true script.Parent.Parent.Value.Value = 0 script.Parent.Parent.click1.Transparency = 0 script.Parent.Parent.click2.Transparency = 1 script.Parent.Sound:Play() wait(0.3) script.Parent.Sound:Stop() end function off() isOn = false script.Parent.Parent.Value.Value = 1 script.Parent.Parent.click1.Transparency = 1 script.Parent.Parent.click2.Transparency = 0 script.Parent.Sound:Play() wait(0.3) script.Parent.Sound:Stop() end function onClicked() if isOn == true then off() else on() end end script.Parent.Parent.click.ClickDetector.MouseClick:connect(onClicked) on()
Basically, if you don't want exploiters to ruin your game for others, you must have Filtering Enabled on. In which case, the changes you make will only render to you, (or, in the exploiters case, the exploiter is the only one who can see it)
Upon turning on FilteringEnabled, your localscripts will no longer function like normal. The reason for this is that with FE off, exploiters can run localscripts on their client, which is not OK as they can modify things in-game.
To fix this, consider using RemoteEvents to make a normal script make the change. If you're just beginning to script, I recommend practicing more until you make a real game. If you think you're confident, FilteringEnabled might be worth looking in to.
Helpful wiki page for remote events: https://wiki.roblox.com/index.php?title=API:Class/RemoteEvent