I get the error attempt to index nil with ‘Connect’ , heres my code:
local Players = game:GetService("Players")
local player = game.Players.LocalPlayer
local Prompts = game.Workspace.CheckIn:GetDescendants("ProximityPrompt")
local TweenService = game:GetService("TweenService")
local UI = game.StarterGui.RoomBookingSystem:GetChildren()
local GroupID = 6880318
local GroupRank = 7
--//AVATAR AND LOCAL PLAYER DATA
-- Fetch the thumbnail
local userId = player.UserId
local thumbType = Enum.ThumbnailType.HeadShot
local thumbSize = Enum.ThumbnailSize.Size420x420
local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
-- Set the ImageLabel's content to the user thumbnail
local imageLabel = script.Parent.Backdrop.UserIcon
imageLabel.Image = content
-- Username
local TextLabel = script.Parent.Backdrop.Text
TextLabel.Text = "@".. player.Name
if TextLabel.Text == "@".. player.Name then
-- ends the code
end
--// Tweens
local UIOpen = TweenInfo.new(
0.5, --Time
Enum.EasingStyle.Sine, -- Style of door open animation
Enum.EasingDirection.InOut, -- Direction of easing.
0, -- Repeat count.
false, -- Will it reverse?
0 -- The delay time.
)
--//ToggleUI
Prompts.Triggered:Connect(function()
return
end)
Any help is appreciated !