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

Why is this not printing the intValue? [closed]

Asked by 10 years ago

sorry if i posted the same post twice but making this in code block might help its not showing errors in the output and its not showing on my gui button

01CanVote = Workspace.canVote
02CanVote.Value=true
03Map1=Workspace.Deathrun
04Map2=Workspace.FFA
05 function Clicked()
06     if CanVote.Value==true then
07    for i=1,1 do
08      Map1.Value=Map1.Value+1
09    end
10    if Map2.Value>0 then
11        for i=1,1 do
12     Map2.Value=Map2.Value-1
13      end
14    end
15    votes=script.Parent
View all 23 lines...
0
You know you can edit a post, right? GoldenPhysics 474 — 10y
0
sorry i am such a noob threatboy101 2 — 10y
0
Anyways, your problem is on lines 18 and 20. You set CanVote.Value to false, then if CanVote.Value equals false (it does) then exit and don't execute anything else in the function. Therefore the print statement is not executed. GoldenPhysics 474 — 10y
0
it prints 2 though threatboy101 2 — 10y
0
please help threatboy101 2 — 10y

Locked by TheMyrco

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 10 years ago

When I ran mine which is basicly like yours it never printed 2. As golden said you need to make the CanVote.Value=true. Also I see that you use for i=1 which just runs it once. I don't think you need them...

0
it has to run once because i dont want it adding values and it prevents glitches threatboy101 2 — 10y
0
I meant you could just simple remove the i=1 and then end with it and it would only run once. I think at least sorry if i'm wrong. GetSporked 5 — 10y
Ad