My script wont work on my GUI (Epilepsy warning)

I am trying to recreate a famous virus called “you are an idiot” (Not a real virus it does nothing please do not flag this post because this is all fake and just a test)

Please tell me if this is a rule breaking post I couldn’t tell

I am trying to get my gui’s to stop off a certain side of the screen then bounce.
Heres what I get:


They go off screen (tell me if video doesn’t work)

I have tried
google

I am trying to make them bounce off the edge of the screen but when I try to do that they go off the screen. I have tried getting the absolute size of the Frame but won’t work.
P.S. This is not a virus, this is a test and doesn’t affect anything in the game or studio or to the client/server.

--// Sorry for the bad code this is just a test and I am not such a good coder when it comes to cleaning up code/DRY
coroutine.wrap(function()
	while true do wait(1)
		if script.Parent.BackgroundColor3 == Color3.fromRGB(0,0,0) then
			script.Parent.BackgroundColor3 = Color3.fromRGB(255,255,255)
		elseif script.Parent.BackgroundColor3 == Color3.fromRGB(255,255,255) then
			script.Parent.BackgroundColor3 = Color3.fromRGB(0,0,0)
		end
	end
end)()

coroutine.wrap(function()
	while true do wait(1)
		for i,image in pairs(script.Parent:GetChildren()) do
			if image:IsA("ImageLabel") then
				if script.Parent.BackgroundColor3 == Color3.fromRGB(0,0,0) then
					image.Image = "rbxassetid://5147587692"
					script.Parent.TextLab.TextColor3 = Color3.fromRGB(255,255,255)
				elseif script.Parent.BackgroundColor3 == Color3.fromRGB(255,255,255) then
					image.Image = "rbxassetid://5681396691"
					script.Parent.TextLab.TextColor3 = Color3.fromRGB(0,0,0)
				end
			end
		end
	end
end)()

script.Parent.Parent.Close.Activated:Connect(function()
	local clone = script.Parent.Parent.Parent:Clone()
	clone.Name = "TestGui"
	clone.Parent = script:FindFirstAncestorWhichIsA("PlayerGui")
	clone.Frame.Size = UDim2.new(0.3, 0,0.32, 0)
	
	coroutine.wrap(function()
		while true do wait()
			clone.Frame:TweenPosition(UDim2.new(1,math.random(-clone.Parent.MainGui.Frame.AbsoluteSize.X,clone.Parent.MainGui.Frame.AbsoluteSize.X),1,math.random(-clone.Parent.MainGui.Frame.AbsoluteSize.Y,clone.Parent.MainGui.Frame.AbsoluteSize.Y)),Enum.EasingDirection.InOut,Enum.EasingStyle.Linear)
		end
	end)()
end)

I would love to know if I am doing something wrong or not.

1 Like

There some adjustments to this post. The video is not loading and the link you put is just Google and doesn’t do anything.

2 Likes

Okay I thought so the forum is a little glitchy for me lemme try to re upload the vid and link you do not need it is just google

1 Like

Okay @Itsjacobiward Tell me if the video works now. It works fine for me.

1 Like

It still doesn’t work are you getting a error when you put the video.

No I am not it just uploads fine but I can check and reupload the file again by making a new one.


Does this work? @Itsjacobiward