So when the update()
is used when the script first runs, it works. However, when it gets activated by the player.PlayerGui.Location.Update.OnServerEvent:Connect(function()
it doesnt? Im completely confused. I know the player.PlayerGui.Location.Update.OnServerEvent:Connect(function()
is working to because I added a print()
to check earlier.
local function update()
local zones = pdata.playerd.UnlockedZones
if table.find(pdata.playerd.UnlockedZones, script.Parent.Name) then
script.Parent.Visible = true
end
end
update()
player.PlayerGui.Location.Update.OnServerEvent:Connect(function()
update()
end)