Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is it always equal to 0?

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

4 comments

0

wheres the print??

0

Whoops, sorry, i forgot to add that.

0

This isn't the whole code, is it?

0

Yea, but that part isn't important. Since it doesnt really relate to the other code block i'm focusing on.

2 answers

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

Don't worry about it

This discussion is preserved as it was. New answers, comments, and votes are closed.