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

IntValues not printing when changed by local script?

Asked by 6 years ago
Edited 6 years ago

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)



0
Can you show us the script? igric 29 — 6y
0
Sure TairaAkiko 26 — 6y
0
Also this is not FE enabled TairaAkiko 26 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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)
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. TairaAkiko 26 — 6y
Ad

Answer this question