Hello! I’m basically trying to make an interactive SurfaceGUI (a computer monitor screen like). However, it doesn’t work at all. It does fade in, but clicking any of the first (Question1) buttons (Answers) doesn’t do anything.
Any idea what is causing this?
Also if somebody got some tips on how to make the script more clear, would be appreciated. I feel like it’s being too repeated and complex for no reason, not sure how to make it simplified tho.
The code: (it’s cut off, there is more below it, but I believe that it doesn’t really matter as even this doesn’t work)
if player:GetRoleInGroup(groupId) == groupRank then
repeat wait() until player.CharacterAdded
wait(10)
local Holder = workspace.Buildings["FBI TRAINING ACADEMY"].ATDesk.Screen.Screen.SurfaceGui.Holder
local CorrectAnswers = Holder.CorrectAnswers
for i = 1,25 do
wait()
Holder.Logo.ImageTransparency = (0+(0.05*i))
end
wait(1)
Holder.Question1.Answer1.Active = true
Holder.Question1.Answer2.Active = true
Holder.Question1.Answer3.Active = true
Holder.Question1.Answer4.Active = true
for i = 1,25 do
wait()
Holder.Question1.BackgroundTransparency = (1-(0.05*i))
Holder.Question1.Answer1.BackgroundTransparency = (1-(0.05*i))
Holder.Question1.Answer1.TextTransparency = (1-(0.05*i))
Holder.Question1.Answer2.BackgroundTransparency = (1-(0.05*i))
Holder.Question1.Answer2.TextTransparency = (1-(0.05*i))
Holder.Question1.Answer3.BackgroundTransparency = (1-(0.05*i))
Holder.Question1.Answer3.TextTransparency = (1-(0.05*i))
Holder.Question1.Answer4.BackgroundTransparency = (1-(0.05*i))
Holder.Question1.Answer4.TextTransparency = (1-(0.05*i))
Holder.Question1.Question.TextTransparency = (1-(0.05*i))
end
local function fadein1()
Holder.Question1.Answer1.Active = false
Holder.Question1.Answer2.Active = false
Holder.Question1.Answer3.Active = false
Holder.Question1.Answer4.Active = false
Holder.Question2.Answer1.Active = true
Holder.Question2.Answer2.Active = true
Holder.Question2.Answer3.Active = true
Holder.Question2.Answer4.Active = true
for i = 1,25 do
wait()
Holder.Question2.BackgroundTransparency = (1-(0.05*i))
Holder.Question2.Answer1.BackgroundTransparency = (1-(0.05*i))
Holder.Question2.Answer1.TextTransparency = (1-(0.05*i))
Holder.Question2.Answer2.BackgroundTransparency = (1-(0.05*i))
Holder.Question2.Answer2.TextTransparency = (1-(0.05*i))
Holder.Question2.Answer3.BackgroundTransparency = (1-(0.05*i))
Holder.Question2.Answer3.TextTransparency = (1-(0.05*i))
Holder.Question2.Answer4.BackgroundTransparency = (1-(0.05*i))
Holder.Question2.Answer4.TextTransparency = (1-(0.05*i))
Holder.Question2.Question.TextTransparency = (1-(0.05*i))
end
end
local function fadein2()
Holder.Question2.Answer1.Active = false
Holder.Question2.Answer2.Active = false
Holder.Question2.Answer3.Active = false
Holder.Question2.Answer4.Active = false
for i = 1,25 do
wait()
Holder.Question3.BackgroundTransparency = (1-(0.05*i))
Holder.Question3.Answer1.BackgroundTransparency = (1-(0.05*i))
Holder.Question3.Answer1.TextTransparency = (1-(0.05*i))
Holder.Question3.Answer2.BackgroundTransparency = (1-(0.05*i))
Holder.Question3.Answer2.TextTransparency = (1-(0.05*i))
Holder.Question3.Answer3.BackgroundTransparency = (1-(0.05*i))
Holder.Question3.Answer3.TextTransparency = (1-(0.05*i))
Holder.Question3.Answer4.BackgroundTransparency = (1-(0.05*i))
Holder.Question3.Answer4.TextTransparency = (1-(0.05*i))
Holder.Question3.Question.TextTransparency = (1-(0.05*i))
end
end
local function fadein3()
Holder.Question3.Answer1.Active = false
Holder.Question3.Answer2.Active = false
Holder.Question3.Answer3.Active = false
Holder.Question3.Answer4.Active = false
Holder.Question4.Answer1.Active = true
Holder.Question4.Answer2.Active = true
Holder.Question4.Answer3.Active = true
Holder.Question4.Answer4.Active = true
for i = 1,25 do
wait()
Holder.Question4.BackgroundTransparency = (1-(0.05*i))
Holder.Question4.Answer1.BackgroundTransparency = (1-(0.05*i))
Holder.Question4.Answer1.TextTransparency = (1-(0.05*i))
Holder.Question4.Answer2.BackgroundTransparency = (1-(0.05*i))
Holder.Question4.Answer2.TextTransparency = (1-(0.05*i))
Holder.Question4.Answer3.BackgroundTransparency = (1-(0.05*i))
Holder.Question4.Answer3.TextTransparency = (1-(0.05*i))
Holder.Question4.Answer4.BackgroundTransparency = (1-(0.05*i))
Holder.Question4.Answer4.TextTransparency = (1-(0.05*i))
Holder.Question4.Question.TextTransparency = (1-(0.05*i))
end
end
---------------------------------
Holder.Question1.Answer1.MouseButton1Click:Connect(function()
Holder.Question1.Visible = false
CorrectAnswers.Value += 1
fadein1()
end)
Holder.Question1.Answer2.MouseButton1Click:Connect(function()
Holder.Question1.Visible = false
fadein1()
end)
Holder.Question1.Answer3.MouseButton1Click:Connect(function()
Holder.Question1.Visible = false
fadein1()
end)
Holder.Question1.Answer4.MouseButton1Click:Connect(function()
Holder.Question1.Visible = false
fadein1()
end)
---------------------------------