#teleporting prblems

3 messages · Page 1 of 1 (latest)

noble axle
#

UI BUTTON: wait(1)

local ExitDormButton = script.Parent
local player = game.Players.LocalPlayer
local debounce = false

ExitDormButton.MouseButton1Click:Connect(function()
if workspace.CurrentCamera.CameraType == Enum.CameraType.Scriptable then
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
end
end)

function teleport()
if not debounce then
debounce = true
LowerTorso = player.Character.LowerTorso
LowerTorso.CFrame = game.Workspace.TPparts.ExitDormTp.CFrame
end
end

ExitDormButton.MouseButton1Click:Connect(teleport)
while true do wait()
debouonce = false
wait(0.5)
end

#

PROMPT: local ProximityPrompt: ProximityPrompt = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DormCameraEvent: RemoteEvent = ReplicatedStorage:WaitForChild("DormCameraEvent")
local TPParts: Folder = workspace:WaitForChild("TPparts")
local DormDoorTP2: BasePart = TPParts:WaitForChild("DormDoorTP2")
--[Triggered event]--
ProximityPrompt.Triggered:Connect(function(plr)
local character = plr.Character
local Humanoid = character:WaitForChild("Humanoid")
local HRP = character:WaitForChild("HumanoidRootPart")
--[Fire Remote]--
DormCameraEvent:FireClient(plr)
--[Setting]--
HRP.CFrame = DormDoorTP2.CFrame
Humanoid.WalkSpeed = 0
Humanoid.JumpHeight = 0
end)

runic cairn
#

can u test if this works on the prompt¿?

local ProximityPrompt: ProximityPrompt = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DormCameraEvent: RemoteEvent = ReplicatedStorage:WaitForChild("DormCameraEvent")
local TPParts: Folder = workspace:WaitForChild("TPparts")
local DormDoorTP2: BasePart = TPParts:WaitForChild("DormDoorTP2")

--[Triggered event]--
ProximityPrompt.Triggered:Connect(function(player)
    
    local Character: Model = player.Character or player.CharacterAdded:Wait()
    local Humanoid = Character:WaitForChild("Humanoid")
    
    local CharCFrame = Character.PrimaryPart.CFrame

    --[Fire Remote]--
    DormCameraEvent:FireClient(player)
    
    --[Setting]--
    
    local DoorCFrame = DormDoorTP2.CFrame
    local CFrameToPut = CFrame.new(DoorCFrame.X, DoorCFrame.Y, DoorCFrame.Z) * CFrame.new(0, 8, 0)
    
    Character:PivotTo(CFrameToPut)
    
    Humanoid.WalkSpeed = 0
    Humanoid.JumpHeight = 0
    
end)