-
What do you want to achieve? I’m trying to make it so that when you click a TextButton, a remote event fires telling the server to teleport that player.
-
What is the issue? It’s pretty much just not working and there aren’t any errors in the output either.
-
What solutions have you tried so far? I’ve had a look at this post but this hasn’t helped me either.
Server Script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TeleportService = game:GetService("TeleportService")
local remote = ReplicatedStorage:WaitForChild("remoteEvents").BossTP
local ID = 10120257817
remote.OnServerEvent:Connect(function()
local player = game:GetService("Players").PlayerAdded:Wait()
print("Teleporting")
TeleportService:Teleport(ID, player)
end)
Button Script:
local remote = game:GetService("ReplicatedStorage").remoteEvents.BossTP
script.Parent.MouseButton1Click:Connect(function(player)
remote:FireServer(player)
end)
Really sorry if this is obvious but I just can’t figure it out.