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!

Spotchoice = {nil,game.ServerStorage.Leftbang,game.ServerStorage.Rightbang,game.ServerStorage.Straightbang,game.ServerStorage.Mohawk,game.ServerStorage.Leftbang}
Index = 1
function Click()
 Index = Index + 1
 local item= Spotchoice[Index]
 if Index >= 6 then
  Index = 1
 end

player = script.Parent.Parent.Parent.Parent.Parent.Character

if player:FindFirstChild("HairValue")== nil then
HairValue = Instance.new("NumberValue",player)
HairValue.Name = "HairValue"

end
    HairValue.Value=Index
        print (HairValue.Value)


-- Morphing things.....
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