So I’m trying to make a system that teleports players to cubicles. The problem is, there is no teleportation both clientside and serverside. the video and the scripts will be attached down there
video:
Serverside view of the player, taken after vid
Button’s script
local button = script.Parent
local repStorage = game:GetService("ReplicatedStorage")
local event = repStorage.playerTeleport
button.MouseButton1Click:Connect(function()
event:FireServer()
end)
Teleportation Script
local players = game.Players:GetChildren()
local rs = game:GetService("ReplicatedStorage")
local tpEvent = rs.playerTeleport
local V3s = require(rs.RoundV3s)
tpEvent.OnServerEvent:Connect(function()
for cubicle, player in pairs(players) do
local plrChar = player.Character
local HRP = plrChar:FindFirstChild("HumanoidRootPart")
HRP.Position = V3s[cubicle]
end
end)
The ModuleScript with the Vector3 value table
local roundV3s = {}
roundV3s.V3s = {
Vector3.new(105.656, 1540.594, 0),
Vector3.new(105.656, 1540.594, 70.875),
Vector3.new(105.656, 1540.594, 35.438),
Vector3.new(35.437, 1540.594, 105.656),
Vector3.new(70.875, 1540.594, 105.656),
Vector3.new(105.656, 1540.594, -70.875),
Vector3.new(105.656, 1540.594, -35.437),
Vector3.new(-105.656, 1540.594, -35.438),
Vector3.new(0, 1540.594, 105.656),
Vector3.new(-35.438, 1540.594, 105.656),
Vector3.new(-35.437, 1540.594, -105.656),
Vector3.new(0, 1540.594, -105.656),
Vector3.new(-105.656, 1540.594, 35.437),
Vector3.new(-70.875, 1540.594, -105.656),
Vector3.new(35.438, 1540.594, -105.656),
Vector3.new(70.875, 1540.594, -105.656),
Vector3.new(-105.656, 1540.594, -70.875),
Vector3.new(-105.656, 1540.594, 0),
Vector3.new(-105.656, 1540.594, 70.875),
Vector3.new(-70.875, 1540.594, 105.656)
}
return roundV3s