i want to make a roblox teleporter which when the player walks up and it says "click E to teleport" and if you click E you teleport i just need to know what to add or change in my code thx
function onTouched(hit) --i know i have to change this but what too-- print("Teleport") local human = hit.Parent:findFirstChild("Torso") brick = script.Parent if (human ~=nil) then human.CFrame= CFrame.new(Vector3.new(-185.8, 357.3, -569.6))--location you want to telport to.-- end end script.Parent.Touched:connect(onTouched) --i dont know about this one--
Make sure this is a local script
function teleport() local char = game:GetService("Players").LocalPlayer.Character char.HumanoidRootPart.CFrame = CFrame.new(-185.8, 357.3, -569.6) end game:GetService("ContextActionService"):BindAction( "Teleport", teleport, false, Enum.KeyCode.E )
https://wiki.roblox.com/index.php?title=API:Class/Mouse/KeyDown
Player = game.Players.LocalPlayer Mouse = Player:GetMouse() if Mouse.KeyDown:connect(function(key) if key == "e" then --code end end
Closed as Not Constructive by User#19524, brokenVectors, and Leamir
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?