Very annoying and weird bug in script

Okay so, the video explains it all.


Basically, some “Frames” go invisible, some disappear for a second, ect.

Script inside each frame. / Server Script

script.Parent.ClickDetector.MouseClick:Connect(function(player)
	game.ReplicatedStorage.FrameLocated:FireAllClients(player.Name)
	
	game.ReplicatedStorage.FrameStats.Visible.Value = true
	
	player.FrameInfo.FramesInv.Value = player.FrameInfo.FramesInv.Value + 1
	game.ReplicatedStorage.FrameStats.FramesTaken.Value = game.ReplicatedStorage.FrameStats.FramesTaken.Value + 1
	script.Parent:Destroy()
end)

Script inside of ServerScriptService.

game.ReplicatedStorage.FrameStats.Visible:GetPropertyChangedSignal("Value"):Connect(function()
	if game.ReplicatedStorage.FrameStats.Visible.Value == true then
		for i,v in pairs(game.Workspace.Frames:GetChildren()) do
			print(v.Name)
			v.Transparency = 1
			v:WaitForChild("SurfaceGui").Enabled = false
			wait(3)
			v.Transparency = 0
			v:WaitForChild("SurfaceGui").Enabled = true
			
			game.ReplicatedStorage.FrameStats.Visible.Value = false
			
		end
	end
end)

Thank you.

It seems as if your only making the black frame invisible. Maybe try making the click detector invisible too? I don’t really know to be honest myself.

A click detector isn’t a solid object, you place it inside of a BasePart and the part will automatically become a button.

1 Like

First snippet has script.Parent:Destroy()

Second snippet has wait(3) and then WaitForChild for the Gui which has been destroyed 3 seconds ago.

2 Likes

Ohhhhhhhh… Got it! Also, how do you get Artist, Designer, etc. next to your name?

Go to this link, then join the group you want to have next to your name, then head over to your preferences tab, and under title, select your group.

1 Like