So I have put in this program: (Slashes start a new line because I don’t know how to do that)

countdown = 1
xvalue = game.ServerStorage.xvalue.Value--i put a number value into the storage and named it xvalue
yvalue = game.ServerStorage.yvalue.Value--same as x
cvalue = game.ServerStorage.cvalue.Value--same as x again
print(xvalue)
print(yvalue)
repeat
	cvalue = xvalue + yvalue
	local xsaver = yvalue
	print(cvalue)
	xvalue = cvalue - yvalue
	yvalue = xsaver
	countdown = countdown + 1
until countdown > 20

(Just so you know, this script is trying to generate the Fibonacci numbers, which starts at one, then another one, then goes to two, then three, then five, the last number plus the second last number)

5 comments

0

You can't make references to attributes... You need to refer to the field each time you wish to read or modify it.

0

Do you mean like game.ServerStorage.xvalue.Value = game.ServerStorage.xvalue.Value + game.ServerStorage.yvalue.Value?

0

Can you give me of an example please?

0

When allocating '[x/y/c]value", you want to make a reference to the Object, not store its current Value. Therefore, remove '.Value'. When you wish to read or modify it, you then use '.Value' at the respective line, yes.

0

LuaU supports shorthands though, which can simplify to: '[x/y/c]value.Value += --[[Number]]'.