#Simple Teleport Service. On button click
1 messages · Page 1 of 1 (latest)
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local night1 = game.Workspace:WaitForChild("Night1")
local startnight1 = night1:WaitForChild("StartNight1")
local startbutton = startnight1:WaitForChild("SurfaceGui"):WaitForChild("TextButton")
-- RemoteEvent in ReplicatedStorage
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local teleportEvent = ReplicatedStorage:WaitForChild("TeleportEvent")
startbutton.MouseButton1Click:Connect(function()
teleportEvent:FireServer()
end)
this is the localscript in SPS
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TeleportService = game:GetService("TeleportService")
local placeId = 137007737910012
local teleportEvent = Instance.new("RemoteEvent")
teleportEvent.Name = "TeleportEvent"
teleportEvent.Parent = ReplicatedStorage
teleportEvent.OnServerEvent:Connect(function(player)
TeleportService:TeleportAsync(placeId, {player})
end)
script in SSS
everything is public. placeID is correct
the id your getting teleported to is a place. and its public
what am i doing wrong
im playing in the roblox player. not the studio
the script for it cant be that complicated. to the point i need to add an LS and an SS. with the remote event right?
most obvious chatgpt
ok
for you?
so what could the error be then
read
@tardy solar .
Why do you have to create a RemoteEvent xd?
Another problem, store your teleportservice inside of a pcall