CustomStore = game:GetService("DataStoreService"):GetDataStore("DataStore") function PlayerEntered(player) local helm = Instance.new("StringValue") helm.Parent = group helm.Name = "Helm" ------------------------------------------------ if CustomStore:GetAsync("Helm_"..player.Name) ~= nil then helm.Value = CustomStore:GetAsync("Helm_"..player.Name) else helm.Value = "Really red" end helm.Changed:connect(function(Val) CustomStore:SetAsync("Helm_"..player.Name, Val) end) ------------------------------------------------ end game.Players.PlayerAdded:connect(PlayerEntered)
This is my script. For some reason, it creates the string value, says "Oh. it's got a value already" (changed from "Really red" to "Really blue"), But won't save NEW changes?
anyone got any ideas?
local player = game.Players.LocalPlayer function onClicked() player.Customisations.Helm.Value = "Lime green" end script.Parent.MouseButton1Down:connect(onClicked)
CONTEXT This is in a LocalScript, Inside TextButton, Inside a Frame, Inside a ScreenGUI, Inside StarterGui.