I’m having troubles with some of my scripts not finding the name of the player touching. It’s a local script inside startergui. What’s weird is that it sometimes work and sometimes it doesn’t.
ArtMuseuma.Touched:Connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr.Name ==
player.Name then
if MyTouch == false then
MyTouch = true
local NameOfTeleport = "ArtMuseumTeleport"
game.ReplicatedStorage.Teleport.NoCheckTeleport:FireServer(NameOfTeleport)
CircularHole:TweenSize(UDim2.new(0.004,0,0.01,0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1)
Right:TweenPosition(UDim2.new(0.756,0,.5,0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1)
Left:TweenPosition(UDim2.new(0.249,0,.5,0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1)
Top:TweenPosition(UDim2.new(.5,0,.245,0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1)
Bottom:TweenPosition(UDim2.new(.5,0, .754 ,0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1)
wait(1)
Middle.Visible = true
wait(.2)
Middle.Visible = false
CircularHole:TweenSize(UDim2.new(1.5,0,2.5,0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1)
Right:TweenPosition(UDim2.new(1.5,0,.5,0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1)
Left:TweenPosition(UDim2.new(-0.49,0,.5,0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1)
Top:TweenPosition(UDim2.new(.5,0,-1,0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1)
Bottom:TweenPosition(UDim2.new(.5,0, 2 ,0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 1)
wait(1)
MyTouch = false
end
end