Error in localscript. Using StringValue like a table

I have table in StringValue, but script don’t want take StringValue as a table

local Services = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent:FindFirstChild("Services")
local AChat = Services:FindFirstChild("AChat")
local Blocklist = AChat:FindFirstChild("Blocklist")

script.Parent.MouseButton1Click:Connect(function(OnClick)
	script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.AChatEvents.PlayerAddedInBlocklist:Fire(script.Parent.Parent.Parent.Parent.UserName.Value)
	wait(0.1)
	script.Parent.Parent.Visible = false
end)
local Services = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent:FindFirstChild("Services")

:skull:

1 Like

what?

what is this?

local Services = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent:FindFirstChild("Services")

This is a folder with Chat information folder
Chat information have blacklist stringvalue

Can you show me a picture of your explorer?


Снимок экрана 2021-11-10 203304

Your script doesn’t take the contents inside of the StringValue as a table because it reads the contents as a string, you need to do some code to convert it into a table for usage. Can you give an example of how the table in the StringValue is displayed

Also, a tip in your case, from what I can see you’re trying to get something in your localplayer, instead of using a lot of .Parent, you can simply do

local Players = game:GetService("Players")

local player = Players.LocalPlayer
-- Then variables that contain items inside of your player

Use string.split() to convert a string into a table, similarly you can use table.concat() to convert a table into a string.

local strings = "Hello world!"
local tables = string.split(strings, " ")
print(tables[1])
print(tables[2])
--tables[1] is "Hello"
--tables[2] id "world!"

First argument to string.split is the string itself, the second argument is a delimiter which specifies how to split the string.