#Teleport issue
1 messages · Page 1 of 1 (latest)
player = game.Players.LocalPlayer
button = script.Parent
local debounce = false
function teleport()
if not debounce then
debounce = true
local LowerTorso = player.Character.LowerTorso
LowerTorso.CFrame = game.Workspace.Voetbalveldteleport.CFrame -- Change "CHANGEYOURPARTNAME" to whatever you rename your part to.
script.Parent.Parent.Visible = false
end
end
button.MouseButton1Click:Connect(teleport)
while true do wait()
debounce = false
wait(2) -- This limits to how often a player can click the teleport button (In seconds).
end```
This is my script I followed a youtube video cause I am new trying to make a game and learn while doing
As horrendously as this is achieving it, this should at least teleport the player, so you probably put the name of the part wrong or don't have the script in the right location
PS, you should probably stop following whatever youtube video gave you this 😔
Whats wrong with it? And I got everything right tho
Its a video from 2 years ago there i no recent teleport video
Your setup seems like it'd work. Is your player in R6 or R15
R15 i think idk I am totally new
R15 is the avatar type that gives the players actual joints and stuff. R6 is the one where the arms, legs, and torso are a single part each
Ohhh tyy
Than this is R15 right?
** You are now Level 1! **
It should be. But just in case, here's a version that should work with either.
player = game.Players.LocalPlayer
button = script.Parent
local teleportPart:BasePart = workspace:WaitForChild("YOURPARTSNAME") --CHANGE YOURPARTSNAME TO THE NAME OF YOUR PART
local debounce = false
local cooldown = 2
function teleport()
if not debounce then
debounce = true
script.Parent.Parent.Visible = false
task.delay(cooldown, function()
debounce = false
script.Parent.Parent.Visible = true
end)
local humanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart")
if not humanoidRootPart then return end
humanoidRootPart.CFrame = teleportPart.CFrame
end
end
button.MouseButton1Click:Connect(teleport)
Still doesn't 😢
Then there's definitely an issue with your setup
Is your part in workspace, or is it in like a model or folder in workspace
Just in workspace
When trying mine, you made sure to change the "("YOURPARTSNAME")" thing right
oh
I see the problem
local player = game.Players.LocalPlayer
local button = script.Parent
local teleportPart:BasePart = workspace:WaitForChild("YOURPARTSNAME") --CHANGE YOURPARTSNAME TO THE NAME OF YOUR PART
local debounce = false
local cooldown = 2
function teleport()
if not debounce then
debounce = true
script.Parent.Parent.Visible = false
task.delay(cooldown, function()
debounce = false
script.Parent.Parent.Visible = true
end)
local humanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart")
if not humanoidRootPart then return end
humanoidRootPart.CFrame = teleportPart.CFrame
end
end
button.MouseButton1Click:Connect(teleport)
try that
may have forgot the local for the player and button
Wait
that's not the problem 😔
Oh what is I just pressed test
You have a breakpoint on line 27
right click and disable it
delete
They pause the execution of scripts for debugging purposes
Theoretically should
Bad news
This is me using the same exact script and basically same setup 😔
I have the button in another frame tho
** You are now Level 2! **
ik
So like a buttons opens GUI and that button teleports you
There is literally only one other thing I could think of that's making it not work when you press it
Are you pressing play or run on studio
I'd assume you aren't pressing run, since then you wouldn't even have a character to teleport, but like, I'm out of ideas lmao
Keep it on test. Can you send a picture of the output?
After you press the button
I can screenshare if you like
Am too lazy for that
😂
Just a picture of the output to make sure there's no errors
Where do I find that?
This is the output
If it's not already there, you can enable it in the "script" tab on the top
Make sure to press play and click the button before taking the picture of the output
If I press Script i just makes a script up top
Do I need to press the button?
You know, I think you might have some more underlying problems than the button 💀
Why is there a script named "Infected" with an "infector" function lol
WAHAHAHHAHA
Maybe stop watching youtube at all 🙏
I have an odd feeling that "Infected" script may, or may not be messing with the button script 😔