I tried to do is when a player touches the brick he/she won't be able to teleport I tried making the script but, sadly fail can anyone help me please thanks!
local db = true
local player = game.Players.LocalPlayer
local target = game.Workspace.TeleportPart
local delay = 3
script.Parent.MouseButton1Click:connect(function()
if db == true then
db = false
player.Character.HumanoidRootPart.CFrame = target.CFrame * CFrame.new(0, 3, 0)
for i = delay, 1, -1 do
script.Parent.Text = i
wait(4)
end
script.Parent.Text = "Teleport to Red Brick"
db = true
end
end)

7 comments
Do I put this in a brick?
?
The whole experience of programming is called trying things out yourself.
@johnneedhelp ignore the guy above me, put it in the text button
The idea of having a variable is to help with maintainability and this is just the same code? -_-
@domnioplayer6 sorry for the late respond it was late at night and I fell alsleep.
@john, this should be a local script placed into a text button under a screen gui in startergui, then it should work