-- local script
local remote = game:GetService("ReplicatedStorage").RemoteFunction
sp.Button.MouseButton1Click:Connect(function () -- Start Progress
print("clicked")
if input == false then
input = true
tweencsspback(.1)
remote:InvokeServer() -- problem here
tweencompletedwait (tweencreverse, tweensreverse, tweenspreverse)
input = false
end
end)
-- script
local remote = game:GetService("ReplicatedStorage").RemoteFunction
local tps = game:GetService("TeleportService")
local TELEPORT_ID = 16340838478
local USER_ID = game.Players:GetPlayers()
local RESERVE_ID = tps:ReserveServer(TELEPORT_ID)
local function teleport ()
print("teleporting")
tps:TeleportToPrivateServer(TELEPORT_ID, RESERVE_ID, USER_ID)
end
remote.OnServerInvoke = teleport
So what I was going to do is when player click the button, it will automatically teleport to another server. From testing the game with 2 players. It suddenly teleport both of them. I tried doing “OnClientEvent” but it doesn’t show on the serverscript. I tried “OnInvokeServer” and it still didn’t work. I’m not that advance on scripting but i want to know if it can do “OnClientEvent” on local script and fires them. Please let me know.