Anyone can help me with this error?. I have tried a lot of things still I can’t fix it.
local button = script.Parent
local service = game:GetService("Players")
local humanoid = service.LocalPlayer.Character:WaitForChild("Humanoid")
local Players = game:GetService("Players")
local siyahgui = game.Players.LocalPlayer.PlayerGui.gui2.policenendingsiyah
local map = game.ReplicatedStorage:WaitForChild("Map")
button.MouseButton1Click:Connect(function()
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local function anchorCharacters(anchor, list)
for _, player in pairs(Players:GetPlayers()) do
local character = player.Character
if character then
if list then
table.insert(list, character)
end
character.PrimaryPart.Anchored = anchor
end
end
end
local function loadMap(map)
local blacklist = {}
anchorCharacters(true, blacklist)
for _, child in pairs(workspace:GetChildren()) do
if not table.find(blacklist, child) then
if not child:IsA("Terrain") then
child:Destroy()
end
end
end
local clone = map:Clone()
clone.Parent = workspace
anchorCharacters(false)
end
loadMap()
siyahgui.BackgroundTransparency = 1
end)