Trying to make it so can chose a class by pressing a Image Button, but it isn't working, I think the event is not firing. There is nothing in the Output, the parenting is correct, and it is in the PlayerGui.
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
Button = script.Parent
Folder = script.Parent.Parent.Parent.Parent.Folder
Chosen_Yet = Folder.Chosen_Class -- Boolean that registers if they have chosen yet
Current = Folder.Current_Class
Colours = {BrickColor.new(152/255, 38/255, 40/255),
BrickColor.new(75/255, 108/255, 90/255),
BrickColor.new(152/255, 38/255, 40/255)}
function Enter()
if not Chosen_Yet then
Button.ImageColor3 = BrickColor.new(156/255, 156/255, 156/255) -- Light Grey
Current.Value = Button.Parent.Name
end
end
Button.MouseEnter:connect(Enter)
function Leave()
if not Chosen_Yet then
Button.ImageColor3 = BrickColor.new(68/255, 68/255, 68/255) -- Dark grey
end
end
Button.MouseLeave:connect(Leave)
function Click()
if not Chosen_Yet and not Current then
Button.ImageColor3 = Colours[1]
Current.Value = script.Parent.Name
Chosen_Yet.Value = true
end
end
Button.MouseButton1Up:connect(Click)
