You have one IntValue Variable on the script, and one IntValue object (a physical element of your game). What your code essentially does, is that it changes the IntValue Variable to the number of the value, rather than the Value of that IntValue.
To fix this, you can change this part of your server code, and it should work.
local function changeValue(player, value)
print(value)
intValue.Value = value -- instead of intValue on its own.
print(intValue.Value) -- to reference the value of the IntValue, do intValue.Value
end
Your script above would still not work, because you are gathering the value from the IntValue. Try out this set of code:
local remoteEvent = game.ReplicatedStorage.RemoteEvent
local intValue = workspace.IntValue
local function changeValue(player, value)
print(value)
intValue.Value = value -- you need to reference the .Value here, not in the variable.
print(intValue.Value)
end
If you do intValue.Value, it’ll return the number stored inside, but it’ll disregard any association to the original variable. As such, you need to call the .value inside of the algorithm.