I made a cool fade in, fade out script in roblox studio when you enter this door

Sorry for my bad grammar, I'm from Denmark,

It's a local script

It fades out for everyone somehow? i don't have a clue why.

local Enter = game.Workspace.Enter
local Frame = script.Parent.Frame

local Debounce = false

local LabDoor = game.Workspace.ScientificResearch.HeyPart
local LabDoorA = game.Workspace.ScientificResearch.LabDoor

Enter.Touched:Connect(function(hit)
	
	local Humanoid = hit.Parent:FindFirstChild("Humanoid")
	
	if Humanoid and not Debounce then
		Debounce = true
		Frame.Visible = true
		
		Humanoid.WalkSpeed = 0
		Humanoid.JumpPower = 0
		
		for i = 1,0,-0.01 do
			wait()
			Frame.BackgroundTransparency = i
			end
			wait(3)
			Debounce = false
			
			hit.Parent:FindFirstChild("HumanoidRootPart").CFrame = LabDoor.CFrame * CFrame.new(0, 6, 0)
			wait(2)
			for a = 0,1,.01 do
				wait()
				Frame.BackgroundTransparency = a
			end
			Humanoid.WalkSpeed = 16
			Humanoid.JumpPower = 50
			end
			end)
			
			local Debounce = false
			local BackHome = game.Workspace.BackHome
			
			LabDoorA.Touched:Connect(function(hit)
				if hit.Parent:FindFirstChild("Humanoid") then
					local Humanoid = hit.Parent.Humanoid
					
					if Humanoid then
						Humanoid.WalkSpeed = 0
						Humanoid.JumpPower = 0
						
						for i = 1,0,-0.01 do
							wait()
							Frame.BackgroundTransparency = i
						end
						hit.Parent:FindFirstChild("HumanoidRootPart").CFrame = BackHome.CFrame * CFrame.new(0, 6, 0)
						wait(2)
						for a = 0,1,.01 do
							wait()
							Frame.BackgroundTransparency = a
						end
						Humanoid.WalkSpeed = 16
						Humanoid.JumpPower = 50
					end
				end
			end)

7 comments

0

Is this on a localscript?

0

Yep

0

What question are you really asking?

0

It's making the gui visible for everyone when they enter

1

You should make sure the person who touched the EnterBrick is the localplayer. if Hit.Parent.Name == game.Players.LocalPlayer.Name then

0

ah, i see. Let me try :)

0

i-. FINE YOU ANSWERED IT. All jokes aside thank you for answering :)