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

Why does my script work solo, but not with multiple people?

Asked by 3 years ago
Edited 3 years ago

local frame = script.Parent local httpService = game:GetService('HttpService') local template = script.Parent:WaitForChild('Template') local tableOfPlayers = game.ReplicatedStorage.Values.TableOfPlayers local decoded = httpService:JSONDecode(tableOfPlayers.Value) local inRound = game.ReplicatedStorage.Values.InRound local function checkForTable(table_, value) for i, v in pairs(table_) do if v == value then return true else return false end end end inRound.Changed:Connect(function() if inRound.Value == false then script.Parent.Visible = false else script.Parent.Visible = true end end) local cor = coroutine.create(function() while true do for i, plr in pairs(game.Players:GetPlayers()) do if checkForTable(decoded, plr.Name) and plr.ListedOnHealth.Value == false then local newTemp = template:Clone() newTemp.Name = plr.Name newTemp.Visible = true newTemp.Parent = table elseif not checkForTable(decoded, plr.Name) and plr.ListedOnHealth == true then local frame = script.Parent:FindFirstChild(plr.Name) frame:Destroy() end end print(decoded) wait(0.01) end end) coroutine.resume(cor)

I can't find the problem. Any help would be appreciated. this is a local script

0
Did you test it in studio Jackmods_YT -12 — 3y

4 answers

Log in to vote
2
Answered by
2_MMZ 1059 Moderation Voter
3 years ago

The only reason why your script works solo, is because that it's a LOCAL script. It happens only on the LOCAL player, that runs the script. You should be able to solve this by copying your code, and pasting it into a regular script in ServerScriptService or Workspace. OR you could just enable API Servers.

Ad
Log in to vote
0
Answered by 3 years ago

make sure you have enabled all services and use a normal script and Published your place.

0
it's in a local script BCthegreat407 12 — 3y
0
tryna with normal script VIImansxryVII 2 — 3y
Log in to vote
0
Answered by
cancle5 120
3 years ago

Make sure it's not a local script and enable API servers. Or just test it in game.

0
if it's a local script how would i change it? BCthegreat407 12 — 3y
Log in to vote
0
Answered by 3 years ago

It needs to be a SCRIPT in ServerScriptService

Answer this question