Help with making a int value add onto a current value/surface-text value using proximity prompt

Hello, so I’m trying to figure out how I could transfer/add-on an ‘Int-Value’ with a value of any number and there is a surface GUI with a text label which also has an ‘Int-Value’ and when that proximity prompt is triggered the value gets added onto the current value of the text label and the text label changes with that value so for example “Current value: 45”, Value: 50, Current value + value = 90.

( Components of the code don’t matter to me, I know some-what of what I’m doing, I just need explaining of how I go about this)

Here is some pseudocode to explain how would u structure it

local Label = SurfaceGui.TextLabel

Prompt.Triggered  --Event connection
local LabelValue = Label.IntValue
local yourValue = intvalue.Value --ur value somewhere
LabelValue.Value += yourValue
Label.Text = LabelValue.Value

Yeah I tried something similar to that and it came up with a string error, I probably messed up the values though.

Can u provide the error part and bit detail of the issue

It was an issue about attempting to perform arithmetic on a string and number, and to me your code looks fine, so it was just on my end. There is nothing wrong with yours, sorry if there was a miscommunication.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.