Hi. I’m working on a game called Castle Period and, CONGRATS MY BLUR WONT REMOVE
It keeps saying infinte yield possible on Lighting:WaitForChild(“UIBlur”). I’ve tried everything, everything, literally EVERYTHING and it wants to keep saying that. The code:
local Player = script.Parent.Parent.Parent
local Content = script.Parent.CharacterFrame.ScrollingFrame.Content
local Characters = game.ReplicatedStorage.Characters
local SetSubject = Characters.Parent.SetSubject
local Create = Instance.new
for index,item in pairs(Characters:GetChildren()) do
if item:FindFirstChild("Humanoid") then
local ViewportFrame = Instance.new("ViewportFrame")
ViewportFrame.Parent = Content
ViewportFrame.BackgroundTransparency = 0.85
ViewportFrame.BackgroundColor3 = Color3.new(0,0,0)
local Corner = Create("UICorner",ViewportFrame)
local Button = Create("TextButton")
Button.Parent = ViewportFrame
Button.Position = UDim2.new(0,0,1,0)
Button.Size = UDim2.new(1,0,0,15)
Button.BorderSizePixel = 0
Button.BackgroundColor3 = Color3.fromRGB(137, 255, 141)
Button.Text = "Spawn"
Button.TextScaled = true
Button.FontFace = Font.new("Titillium Web", Enum.FontWeight.Thin, Enum.FontStyle.Italic)
local Preview = item:Clone()
Preview.Parent = ViewportFrame
local Camera = Create("Camera")
print(Camera.Parent)
Camera.Parent = ViewportFrame
Camera.CFrame = Preview.Head.CFrame + Preview.Head.CFrame.LookVector * 5
Camera.CFrame = CFrame.new(Camera.CFrame.Position,Preview.Head.Position)
ViewportFrame.CurrentCamera = Camera
Button.MouseButton1Down:Connect(function()
script.Parent.Enabled = false
local ChosenCharacter = item:Clone()
local CurrentCharacter = Player.Character
local LocalScripts = {}
for index2,item2 in pairs(game.StarterPlayer.StarterCharacterScripts:GetChildren()) do
if item2:IsA('LocalScript') then
table.insert(LocalScripts,item2:Clone())
else
item2:Clone().Parent = ChosenCharacter
end
end
CurrentCharacter.Health:Clone().Parent = ChosenCharacter
table.insert(LocalScripts,CurrentCharacter.Animate:Clone())
ChosenCharacter.Parent = workspace
Player.Character = ChosenCharacter
for index2,item2 in pairs(LocalScripts) do
item2.Parent = ChosenCharacter
end
SetSubject:FireClient(Player,ChosenCharacter.Humanoid)
local Connection
local function onDied()
wait(game.Players.RespawnTime)
Player:LoadCharacter()
script.Parent.Enabled = true
if Connection then
Connection:Disconnect()
end
end
Connection = ChosenCharacter.Humanoid.Died:Connect(onDied)
a = game.Lighting:WaitForChild("UIBlur", 5)
if a:IsA("BlurEffect") then
a.Size = 0
end
end)
end
end
I’ve searched it up and renamed it. It exists! I swear-