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

Teleport on TextButton press not working?

Asked by 3 years ago

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

Log in to vote
1
Answered by 3 years ago

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

0
I have enabled it and nothing has changed. SubNinjaPav 7 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

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)
0
still doesnt work i've also tried mousebutton1up SubNinjaPav 7 — 3y
0
try it on a serverside script meaning the variable "player" has to be parented KripticalYT 100 — 3y

Answer this question