You see, I have added an IntValue in ServerStorage, and used this script in a Part in workspace:
1 | local part = workspace.Part |
2 | part.Touched:Connect( function () |
3 | game.ServerStorage.IntValue.Value = 1 |
4 | if game.ServerStorage.IntValue.Value = = 1 then |
5 | part.Color = BrickColor.new( "Really red" ) |
6 | end |
7 | end ) |
Instead, try this:
1 | local part = workspace.Part |
2 | part.Touched:Connect( function () |
3 | game.ServerStorage.IntValue.Value = 1 |
4 | game.ServerStorage.IntValue.Changed:Connect( function () |
5 | if game.ServerStorage.IntValue.Value = = 1 then |
6 | part.Color = BrickColor.new( "Really red" ) |
7 | end |
8 | end |
9 | end ) |