Check the video
https://gyazo.com/1a9ee645d334a652e9503aa928737f4d
(I can send some more code if you need)
This is my second time posting this I really need help with this
local module = require(script.ClassSelection)
local Player = game.Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
local Hum = Char:WaitForChild("Humanoid")
local ClassSelectionFolder = Player.PlayerGui.ClassSelectionUI
local CurrentClassFolder = ClassSelectionFolder.Classes
local ClassText = ClassSelectionFolder.SelectionScreen.Frame.TextLabel
local PlayButton = ClassSelectionFolder.SelectionScreen:WaitForChild("Frame").TextButton
local ClassSelected = ""
Char:GetAttributeChangedSignal("Class"):Connect(function()
print("Sup")
end)
module:ChoosenClass(CurrentClassFolder,ClassSelected,ClassText)
module:Start(PlayButton,Char)
--!nocheck
local Player = game.Players.LocalPlayer
local PlayerUi = Player.PlayerGui
local ClassSelectionFolder = PlayerUi:WaitForChild("ClassSelectionUI")
local ClassSelected = ""
local DB = false
local Table = {}
local module = {}
function module:ChoosenClass(ClassFolder:Folder,SelectedClass:string,SelectionScreenText)
for i,v in ClassFolder:GetChildren() do
if v.ClassName == "ImageButton" then
v.MouseButton1Click:Connect(function()
for ii,vv in v:GetChildren() do
if vv.ClassName == "TextLabel" then
SelectedClass = vv.Text
SelectionScreenText.Text = SelectedClass
end
end
end)
end
end
end
function module:Start(PlayButton,Char)
PlayerUi.ChildAdded:Connect(function()
print("Sup")
end)
PlayButton.MouseButton1Click:Connect(function()
if DB == true then ClassSelectionFolder:Destroy() end
if ClassSelectionFolder.SelectionScreen.Frame.TextLabel.Text ~= "Choosen Class:" and not DB then
DB = true
Char:SetAttribute("Class",ClassSelectionFolder.SelectionScreen.Frame.TextLabel.Text)
ClassSelectionFolder:Destroy()
end
end)
end
return module