Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Teleport on TextButton press not working?

When i press on the textbutton nothing happens. In output nothing is written. And in game still nothing. I have put a local script inside a textButton which is :

local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local PlayerGui = Players:WaitForChild("PlayerGui")
local LoadingScreen = ReplicatedStorage:WaitForChild("Loading")

script.Parent.MouseButton1Click:Connect(function()
	local TempLoadingScreen = LoadingScreen:Clone()
	TempLoadingScreen.Parent = PlayerGui
	TeleportService:SetTeleportGui(TempLoadingScreen)
	TeleportService:Teleport(6958449453, player)
end)

Could anyone help me?

2 answers

go to game settings, security and the enable the one that have teleport and 3rd party

1 comment

0

I have enabled it and nothing has changed.

MouseButton1Click to MouseButton1Down

local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local PlayerGui = Players:WaitForChild("PlayerGui")
local LoadingScreen = ReplicatedStorage:WaitForChild("Loading")

script.Parent.MouseButton1Down:Connect(function()
    local TempLoadingScreen = LoadingScreen:Clone()
    TempLoadingScreen.Parent = PlayerGui
    TeleportService:SetTeleportGui(TempLoadingScreen)
    TeleportService:Teleport(6958449453, player)
end)

2 comments

0

still doesnt work i've also tried mousebutton1up

0

try it on a serverside script meaning the variable "player" has to be parented

This discussion is preserved as it was. New answers, comments, and votes are closed.