Simple script, however it has a error in the output that not permits me from acessing it!
This is a script that opens a screengui.
LocalScript:
local Player = game:GetService("Players").LocalPlayer
local Gui = script.Parent
local teamColors = {
BrickColor.new("White")
}
local Screen = workspace.Map.CCI.SCW.Decoration.ControlLockdown:FindFirstChild("ScreenPanel")
local Button = Screen:WaitForChild("SurfaceGui").TextButton
Button.MouseButton1Click:Connect(function()
for _, Color in pairs(teamColors) do
if Player.TeamColor == Color then
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
Gui.LockdownFrame.Visible = true
Humanoid.WalkSpeed = 0
Humanoid.JumpHeight = 0
end
end
end)
Output:
20:16:38.198 Players.OmqFroko.PlayerGui.LockdownService.LockdownS:9: attempt to index nil with 'WaitForChild' - Cliente - LockdownS:9```