So I just got done fixing all my Gui's from turning filtering enabled on. Now I'm not sure if this script breaking is a direct result of filtering enabled or if this has always been a problem. I just played my game with friends and when a player touches a brick it teleports all players besides just the one who touched the brick. Here's what I think is the important part of my script.
Part.Touched:connect(function()
local Spawn = game.Workspace.TeleportAndSpawnStorage.RandomFunRoomSpawn
for _, player in pairs(game.Players:GetPlayers()) do
local Torso = player.Character:WaitForChild("Torso")
Torso.CFrame = CFrame.new(Spawn.Position + Vector3.new(0, 2 ,0))
end
end)
However, because I have no clue what's wrong, here's the whole script.
local Part = script.Parent
Part.Touched:connect(function()
local Spawn = game.Workspace.TeleportAndSpawnStorage.RandomFunRoomSpawn
for _, player in pairs(game.Players:GetPlayers()) do
local Torso = player.Character:WaitForChild("Torso")
Torso.CFrame = CFrame.new(Spawn.Position + Vector3.new(0, 2 ,0))
end
for _, player in pairs(game.Players:GetPlayers()) do
if player:FindFirstChild("leaderstats") then
if player:FindFirstChild("MemoryGameBeat").Value == false then
player.leaderstats.RoundsBeaten.Value = player.leaderstats.RoundsBeaten.Value + 1
player:FindFirstChild("MemoryGameBeat").Value = true
player.leaderstats.Points.Value = player.leaderstats.Points.Value + 7
end
if player:FindFirstChild("Backpack") then
player.Backpack.RemoteClient.ChangeGui:FireClient(player)
end
player.PlayerSoundFolder.MemoryGameLevelOneWinnerSound:Play()
wait(43)
local Spawn = game.Workspace.TeleportAndSpawnStorage.TeleportSpawn
for _, player in pairs(game.Players:GetPlayers()) do
local Torso = player.Character:WaitForChild("Torso")
Torso.CFrame = CFrame.new(Spawn.Position + Vector3.new(0, 2 ,0))
end
wait(10.5)
player.PlayerSoundFolder.MemoryGameLevelOneWinnerSound:Stop()
end
end
end)
Now I'm sure this might not be the most clean script ever, but I really need help. Would making this into a local script help maybe? It's just I have a teleport Gui that teleports all players too and that's a local script so I'm sorta stuck.

2 comments
Thanks! I feel sorta dumb that I made a mistake like that but oh well. I'm only human. Thanks again (=
No problem!