#Proximity prompt not triggering after teleport.

1 messages · Page 1 of 1 (latest)

delicate oriole
#

After clicking on the yellow orb thingy, a server script triggers an event on the local script to fade to a black screen. Afterwards, the server script moves the player to the upper floor. Even though they worked before using the teleporter, all of the proximity prompts no long work. Even when I disable the local script, which fades to the black screen, the bug still occurs.

-- Teleporter script --

local rs = game:GetService("ReplicatedStorage")
local Event = rs:WaitForChild("BlackGui")

local Time = 1

script.Parent.MouseClick:Connect(function(Player)
    Event:FireClient(Player, Time, script.Parent)
    task.wait(1.1)
    local HRP = Player.Character:WaitForChild("HumanoidRootPart")
    HRP.Position = Vector3.new(HRP.Position.X,48.127,HRP.Position.Z)
end)

-- Script used in all of the doors (proximity prompts) --

local Door = script.Parent.Parent.Parent:WaitForChild("Union")
local Prompt = script.Parent
local Door2 = Door.Parent:WaitForChild("Door2")
local Sound = script.Parent.Parent:WaitForChild("DoorOpen")

local TweenService = game:GetService("TweenService")
local Tweeninfo = TweenInfo.new(2)

local Goal1 = {}
Goal1.Position = Door2.Position

local Goal2 = {}
Goal2.Position = Door.Position

local Tween1 = TweenService:Create(Door,Tweeninfo,Goal1)
local Tween2 = TweenService:Create(Door,Tweeninfo,Goal2)

local CanOpen = true

Prompt.Triggered:Connect(function()
    print("Triggered")
    if CanOpen == true then
        CanOpen = false
        Tween1:Play()
        Prompt.Enabled = false
        Sound:Play()
            wait(12)
        Tween2:Play()
        Sound:Play()
            wait(2)
        Prompt.Enabled = true
        CanOpen = true
    end
end)
spark cypress
delicate oriole
#

No it's a server script

spark cypress
#

Ok

#

Hold on, are you using server script in the gui object?

#

cuz of the script.Parent.MouseButton1Click

#

Oh nvm

#

I read it wrong

#

Does it has any errors in the output?

delicate oriole
#

No, but the 'print("Triggered")' part in the door script doesn't work after teleporting

velvet gull
#

Can you tell me if the scripts are server or local?

delicate oriole
spark cypress
#

Might be something wrong with the prompt

delicate oriole
#

I did some testing and found out that when HRP.Position = Vector3.new(HRP.Position.X,48.127,HRP.Position.Z) is removed, the prompts work again. Idk how to fix it, but I'm pretty sure it has something to do with being teleported.