Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Teleporter only shows gui once, but can't show it again?

Asked by 4 years ago

Hi, I'm trying to make a teleporter which creates a button to go back, but it seems like it does not work properly.. Any help? Cause output won't show anything..

local Enter1 = workspace:WaitForChild("Scriptable"):WaitForChild("Enter")
local Enter2 = workspace:WaitForChild("Scriptable"):WaitForChild("Enter2")
---------------------------------------------------------------------------
Enter1.Touched:Connect(function(hit)
    if hit.Parent:IsA("Accessory") then return end
    if hit.Parent.Humanoid then
        hit.Parent:FindFirstChild("HumanoidRootPart").CFrame = CFrame.new(-169.44, 48.004, -8.307)
        game.Players:FindFirstChild(hit.Parent.Name):WaitForChild("PlayerGui"):WaitForChild("ScreenGui"):WaitForChild("TextButton").Visible = true
    end
end)

Enter2.Touched:Connect(function(hit)
    if hit.Parent:IsA("Accessory") then return end
    if hit.Parent.Humanoid then
        hit.Parent:FindFirstChild("HumanoidRootPart").CFrame = CFrame.new(-169.44, 48.004, -38.051)
        game.Players:FindFirstChild(hit.Parent.Name):WaitForChild("PlayerGui"):WaitForChild("ScreenGui"):WaitForChild("TextButton").Visible = true
    end
end)

1 answer

Log in to vote
2
Answered by 4 years ago

nevermind! i solved it by putting an identical script into the localscript which is placed in the startergui. :D

Ad

Answer this question