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

My script to make 1 value 1 more then a different value won't work?

Asked by 9 years ago

For a RPG like game, I am trying to make it so the Level will only go up by one if the lastlevel value is the same as the level.

P = game.Players.LocalPlayer

while true do
wait()
P.bin.Level.Value = P.bin.LastLevel.Value + 1
end
0
Try "if (level) == (lastlevel) then (level) = (level) + 1 end" (replacing (level) and (lastlevel) with the appropriate paths). Put on line 5. GoldenPhysics 474 — 9y

2 answers

Log in to vote
1
Answered by 9 years ago

If it's a NumberValue, it probably won't work. You'd probably need an IntValue. And use the same script.

Or keep it a NumberValue and do:

P = game.Players.LocalPlayer

while true do
wait()
P.bin.Level.Value = tonumber(P.bin.LastLevel.Value) + 1
end

0
NumberValues will work. DigitalVeer 1473 — 9y
0
No. They never did for me. TypicalModerator 110 — 9y
0
Number Values do work; They just allow the use of Decimals (Example: 1.25, 1.64, .54, .43, ect.), unlike Int Values where they only allow an Estimated whole number (Example: 1, 2, 76, 43, 56, ect.). TheeDeathCaster 2368 — 9y
0
Yes, Numbervalues work. This script used to work perfect. Then I think roblox broke it with an update. attackonkyojin 135 — 9y
Ad
Log in to vote
-3
Answered by
snow29 0
9 years ago

Another thing, Don't forget wait() in loops or lag will probably kill everything.

Answer this question