I have my game set up so that all players get stringValues inside of them with the value "Linked", and for some reason whenever I do local servers or play with my friend on the server, only one character has the value "Linked." Why isn't this working?
local DataStore = game:GetService("DataStoreService"):GetDataStore("DataStorage")
--[[function TweenIncentive()
for i, v in pairs(game.Players:GetPlayers()) do
v.PlayerGui.PlayerScreenGui.LogInReward:TweenPosition(0, 600, 0, 0)
wait(3)
v.PlayerGui.PlayerScreenGui.LogInReward:TweenPosition(0, 2000, 0, 0)
v.PlayerGui.PlayerScreenGui.LogInReward.Position = UDim2.new(0, -100, 0, 0)
end
end]]
local StartingPoints = 500
local StartingLevel = 0
local DefaultSword = "Linked"
local Opening = script.OpeningScreen:Clone()
game.Players.PlayerAdded:connect(function(player)
local key = "user_" .. player.userId
Opening.Parent = player.PlayerGui
game.Workspace.NumberIsInPlace.Value = game.Workspace.NumberIsInPlace.Value + 1
--[[if player.Name == "JamaicaHolder" then
player.Character.Humanoid.WalkSpeed = 30
pl
end]]
local PlayerInf = Instance.new("Folder", player )
PlayerInf.Name = "PlayerInfo"
local stats = Instance.new("ObjectValue", player)
stats.Name = "leaderstats"
local points = Instance.new("IntValue", PlayerInf)
points.Name = "Player Points"
local level = Instance.new("NumberValue", stats)
level.Name = "Level"
level.Value = "Linked"
--[[if player.Name == "JamaicaHolder" then
player:WaitForChild("Player Points").Value = 10000000000
end]]
local ingame = Instance.new("BoolValue", player)
ingame.Name = "Ingame"
local chosensword = Instance.new("StringValue", player)
chosensword.Name = "PersonalSword"
chosensword.Value = DefaultSword
local thewins = Instance.new("IntValue", player)
thewins.Name = "Wins"
local streaknumber = Instance.new("IntValue", player)
streaknumber.Name = "Streak"
local GetSaved = DataStore:GetAsync(key)
local Swords = Instance.new("ObjectValue", player)
Swords.Name = "Swords"
local Items = Instance.new("ObjectValue", player)
Items.Name = "Items"
local FreeLinked = Instance.new("BoolValue", Swords)
FreeLinked.Name = "Linked"
local IsInGame = Instance.new("BoolValue", player)
IsInGame.Name = "GameBool"
IsInGame.Value = true
local trueGameBool = Instance.new("BoolValue", IsInGame)
trueGameBool.Name = "trueIsInGameBool"
local DarkHeartSword = player.Swords:FindFirstChild("DarkHeart")
local FireBrandSword = player.Swords:FindFirstChild("FireBrand")
local GhostWalkerSword = player.Swords:FindFirstChild("GhostWalker")
local IlluminaSword = player.Swords:FindFirstChild("Illumina")
local VenomShankSword = player.Swords:FindFirstChild("VenomShank")
local WindForceSword = player.Swords:FindFirstChild("WindForce")
local SmallLinkedSword = player.Swords:FindFirstChild("SmallLinked")
local LargeLinkedSword = player.Swords:FindFirstChild("LargeLinked")
local swords = player.Swords
local SavedLevel = DataStore:GetAsync(player.userId..'Level')
local SavedSword = DataStore:GetAsync(player.userId..'PersonalSword')
if SavedLevel ~= nil then
level.Value = SavedLevel
end
if SavedSword ~= nil then
chosensword.Value = SavedSword
end
if GetSaved then
points.Value = GetSaved[1]
thewins.Value = GetSaved[2]
chosensword.Value = GetSaved[3]
streaknumber.Value = GetSaved[4]
swords = GetSaved[14]
if DarkHeartSword then
DarkHeartSword.Value = GetSaved[5]
end
if FireBrandSword then
FireBrandSword.Value = GetSaved[6]
end
if GhostWalkerSword then
GhostWalkerSword.Value = GetSaved[7]
end
if IlluminaSword then
IlluminaSword.Value = GetSaved[8]
end
if VenomShankSword then
VenomShankSword.Value = GetSaved[9]
end
if WindForceSword then
WindForceSword.Value = GetSaved[10]
end
if SmallLinkedSword then
SmallLinkedSword.Value = GetSaved[11]
end
if LargeLinkedSword then
LargeLinkedSword.Value = GetSaved[12]
end
if FreeLinked then
FreeLinked.Value = GetSaved[13]
end
--[[if os.time()-time > 86400 then
TweenIncentive()
else
--24 hours has not passed
end]]
--[[
local SaveSwords = player.Swords:GetChildren()
for i, v in pairs(SaveSwords) do
local NumbersForSaving = {points.Value,
thewins.Value,
chosensword.Value,
streaknumber.Value,
SaveSwords
}
DataStore:SetAsync(key, NumbersForSaving)
end]]
end
--[[if Time > 43200 then
player.leaderstats.Streak.Value = player.leaderstats.Streak.Value + 1
TweenIncentive()
end]]
player.Character.Humanoid.WalkSpeed = 0
player.GameBool.trueIsInGameBool.Value = false
end)
game.Players.PlayerRemoving:connect(function(player)
game.Workspace.NumberIsInPlace.Value = game.Workspace.NumberIsInPlace.Value - 1
local key = player.userId
local SaveSwords = player.Swords:GetChildren()
local LevelValue = player.leaderstats.Level.Value
local SwordValue = player.PersonalSword.Value
DataStore:SetAsync(key..'-Level', LevelValue)
DataStore:SetAsync(key..'-PersonalSword', SwordValue)
for i, v in pairs(SaveSwords) do
local Savetable = {
player.PlayerInfo["Player Points"].Value,
player.Wins.Value,
player.PersonalSword.Value,
player.Streak.Value,
v.Value
}
DataStore:SetAsync(key, Savetable)
end
end)

12 comments
Could you add a script?
Oh thx
It's the "PersonalSword" part that isn't working.
what line is it on? Is there an error in studio?
I have no idea if there is an error in studio, personal sword is on line 53
play the game and check the output
then tell me the output
For player 1 and player 3, both have "linked" as the value but not player 2. But there's nothing wrong with the output.
hm
try to not use deprecated methods
I corrected the parents
This problem still persists