#Simple Teleport Service. On button click

1 messages · Page 1 of 1 (latest)

fiery ingot
#
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

fiery ingot
#

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?

tardy solar
#

is the place public

#

it teleports so it’s not a script error

fiery ingot
fiery ingot
tardy solar
#

what

#

the image you sent

fiery ingot
#

so what could the error be then

tardy solar
fiery ingot
tiny notch
tiny notch