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

IntValues not printing when changed by local script?

I have a script to change the value of one of the intvalues, but when I print the value after it's changed it still displays the old value, this happens in a server as well as studio.

local player = script.Parent.Parent.Parent.Parent.Parent
local finish = script.Parent.Parent.Controls.Finished

local DSS = game:GetService("DataStoreService")

hair = game.Lighting.Values.Hair.Value
hairc = game.Lighting.Values.HairC.Value
Skin = game.Lighting.Values.Skin.Value
face = game.Lighting.Values.Face.Value
--
scope = "player_" .. player.UserId
char = DSS:GetDataStore("Character", scope)	
print(scope)
--
finish.MouseButton1Click:connect(function()
	pcall(function()
		char:SetAsync("Hair", hair)
		char:SetAsync("Hairc", hairc)
		char:SetAsync("Skin", Skin)
		char:SetAsync("Face", face)
	end)
	print(hair,hairc,Skin,face)
end)



3 comments

0

Can you show us the script?

0

Sure

0

Also this is not FE enabled

1 answer

✓ Accepted answer

It's probably best you have a function for whenever the value changes like this,

(Insert Value Here).Changed:connect(function(newValue)
	print(newValue)
end)

1 comment

0

I'm using it to keep track of what the player chooses, and to print them at the end, but all the values come out the same no matter what choice is picked, despite it changing in properties.

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