Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why isn't this IntValue changing?

Asked by 9 years ago

Background Information: FilteringEnabled is on. I'm using a RemoveEvent to send Data between the Server and the Client. The number gets transferred, but the IntValue value doesn't change. The IntValue is in the Gui with the Client Localscript. It does not work with FilteringEnabled off. The Gui does show up, so it is being called. It is NOT an error with the DoorStop. It is in a localscript.

Okay, so I have a brick, so that when you do indeed touch it, it sends a Client event to the player, that part works. However, the number transfers, but the IntValue does NOT change. Whether it's from me referencing the IntValue wrong, or it's an issue with it in general.

My script is below:

event = game.ReplicatedStorage.OpenDoors

DoorVal = script.Parent.DoorValue

event.OnClientEvent:connect(function(...)
local tuple = {...}
if tuple[1] == "Door" then
DoorVal.Value = tuple[2]
script.Parent.Label.Visible = true
elseif tuple[1] == "DoorStop" then
DoorVal.Value = 0
script.Parent.Label.Visible = false
end
end)

This is where the error resides, because I've manually changed the value (I.E: Changing the value, saving the game and going in game/Changing it then Play Solo.) and it worked. Please help, and thanks in advance.

0
Can you `print` `tuple[2]` to see what the value is? BlueTaslem 18071 — 9y
0
As I said, it DOES transfer the number, it just doesn't change the variable. I've tried it. LennyTheLucario 45 — 9y
0
Gosh, that sounded a little snotty/angry, so if I offended you, I used the caps for emphasis. LennyTheLucario 45 — 9y
0
Just a suggestion -- try making the int value you're trying to change into a NumValue. I've had issues with IntValues that were solved by switching (even if it was only transferring whole numbers). If this works and you need an IntValue, there's always math rounding. If this doesn't work, then feel free to disregard the whole thing! RoboFrog 400 — 9y
0
Still not working; oh well. Thanks anyway. LennyTheLucario 45 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

If the tuple args are strings (which they probably are), you'd want to do DoorVal.Value = tonumber(tuple[2]) for line 8.

0
It still did not work, but thanks anyway. LennyTheLucario 45 — 9y
0
Thanks. bobafett3544 198 — 9y
Ad

Answer this question