I somehow forgot how to write a line of code for touching a brick to trigger something. Right now i have this:
script.Parent.Touched:Connect(function(player)
game:GetService("TeleportService"):Teleport(3299820826)
end)
The end) is messed up by the string.
So I mainly just need an explanation. A working script would be fine as well.
To get the player from a touch event you need to first check if the thing who touched the part is a player then you can use :GetPlayerFromCharacter to get the player from hit.Parent.
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild('Humanoid') then local Player = game.Players:GetPlayerFromCharacter(hit.Parent) game:GetService("TeleportService"):Teleport(3299820826,Player) end end)