local U=game:GetService(`CoreGui`)local X=game:GetService(`ReplicatedStorage`)local L=game:GetService(`TextService`)local j=game:GetService(`SoundService`)local N=game:GetService(`TweenService`)local H=game:GetService(`UserInputService`)if U:FindFirstChild(`MainUI`)then U.MainUI:Destroy()end local f=Instance.new(`ScreenGui`)f.Name=`MainUI`f.Parent=U local u=Instance.new(`Frame`)u.Name=`MainFrame`u.Size=UDim2.new(0,250,0,80)u.Position=UDim2.new(.5,-125,.1,0)u.BackgroundColor3=Color3.fromRGB(30,30,30)u.BorderSizePixel=0 u.Parent=f local m=Instance.new(`UICorner`)m.CornerRadius=UDim.new(0,12)m.Parent=u local I=Instance.new(`TextLabel`)I.Name=`Title`I.Size=UDim2.new(1,0,.3,0)I.BackgroundTransparency=1 I.Text=`Correct Answer:`I.TextColor3=Color3.fromRGB(200,200,200)I.Font=Enum.Font.GothamMedium I.TextSize=14 I.Parent=u local q=Instance.new(`TextLabel`)q.Name=`AnswerLabel`q.Size=UDim2.new(.9,0,.6,0)q.Position=UDim2.new(.05,0,.3,0)q.BackgroundTransparency=1 q.Text=`Waiting...`q.TextColor3=Color3.fromRGB(50,255,100)q.Font=Enum.Font.GothamBold q.TextSize=24 q.TextScaled=false q.TextWrapped=false q.Parent=u local function a(U)q.Text=U local X=L:GetTextSize(U,q.TextSize,q.Font,Vector2.new(math.huge,80))local j=X.X local H=60 local f=math.max(250,j+H);(N:Create(u,TweenInfo.new(.3,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),{Size=UDim2.new(0,f,0,80)})):Play()end local T,Q,Y,V u.InputBegan:Connect(function(U)if U.UserInputType==Enum.UserInputType.MouseButton1 or U.UserInputType==Enum.UserInputType.Touch then T=true Y=U.Position V=u.Position U.Changed:Connect(function()if U.UserInputState==Enum.UserInputState.End then T=false end end)end end)u.InputChanged:Connect(function(U)if U.UserInputType==Enum.UserInputType.MouseMovement or U.UserInputType==Enum.UserInputType.Touch then Q=U end end)H.InputChanged:Connect(function(U)if U==Q and T then local X=U.Position-Y u.Position=UDim2.new(V.X.Scale,V.X.Offset+X.X,V.Y.Scale,V.Y.Offset+X.Y)end end)local g=X:WaitForChild(`Remotes`)local F=g:WaitForChild(`SubmitAnswer`)local h=g:WaitForChild(`PlaySound`)local R=(j:WaitForChild(`EffectSounds`)):WaitForChild(`Correct`)F.OnClientEvent:Connect(function(U,X)if X and type(X)==`string`then a(X)elseif U and type(U)==`string`then a(U)end end)h.OnClientEvent:Connect(function(U,X)if U==R then task.wait(1.5)a(`Waiting...`)end end)a(`Waiting...`)
Comments
Follow for more script like this!