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

Why is it always equal to 0?

Asked by 9 years ago

I've tried to make a script where you save the Values,** but, when i print the Value, it's always says the number 0...**

If i'm doing this wrong, or just put the Value creation in the wrong place, please tell me!

01Spotchoice = {nil,game.ServerStorage.Leftbang,game.ServerStorage.Rightbang,game.ServerStorage.Straightbang,game.ServerStorage.Mohawk,game.ServerStorage.Leftbang}
02Index = 1
03function Click()
04 Index = Index + 1
05 local item= Spotchoice[Index]
06 if Index >= 6 then
07  Index = 1
08 end
09 
10player = script.Parent.Parent.Parent.Parent.Parent.Character
11 
12if player:FindFirstChild("HairValue")== nil then
13HairValue = Instance.new("NumberValue",player)
14HairValue.Name = "HairValue"
15 
View all 21 lines...
0
wheres the print?? NinjoOnline 1146 — 9y
0
Whoops, sorry, i forgot to add that. CrammelApple 50 — 9y
0
This isn't the whole code, is it? BlueTaslem 18071 — 9y
0
Yea, but that part isn't important. Since it doesnt really relate to the other code block i'm focusing on. CrammelApple 50 — 9y

2 answers

Log in to vote
1
Answered by 9 years ago

Please provide us with the full code.

Ad
Log in to vote
0
Answered by 9 years ago

Sorry! I actually screwed up with the Data Stores and stuff

Don't worry about it

Answer this question