This script is supposed to recive a teleport of group of players data, but somehow its decided to take a random player points/wins and make it the entire players on the server the same points/wins.
local safeTeleport = require(script.SafeTeleport)
local approvedPlaceIds = {9073506532} -- insert approved PlaceIds here
local function isPlaceIdApproved(placeId)
for _, id in pairs(approvedPlaceIds) do
if id == placeId then
return true
end
end
return false
end
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local wins = Instance.new("IntValue")
wins.Name = "Endings"
wins.Parent = leaderstats
local joinData = player:GetJoinData()
if isPlaceIdApproved(joinData.SourcePlaceId) then
local teleportData = joinData.TeleportData
if teleportData then
local endData = teleportData.Endings
wins.Value = endData
print(player, "data has been collected with", endData, "Endings")
end
end
end)
Heres the teleporting to another player script if you can’t find any errors
local TeleportService = game:GetService("TeleportService")
local SafeTele = require(game.ServerScriptService.SafeTp)
while true do
for i = 30,0,-1 do
script.Parent.Parent.CarTP.SurfaceGui.Frame.time.Text = i
if workspace.RoadLane1.CarTP.PlrInCar.Value == 0 then
workspace.RoadLane1.CarTP.SurfaceGui.Frame.Status.TextColor3 = Color3.fromRGB(255, 255, 0)
workspace.RoadLane1.CarTP.SurfaceGui.Frame.Status.Text = "NEED PLAYERS"
end
wait(1)
end
-- Move truck
-- Reserve server
local players = {}
for i, v in pairs(script.Parent.Seats:GetChildren()) do
if v.Occupant then
print("Occupant found. "..v.Parent.Name)
table.insert(players,game.Players:GetPlayerFromCharacter(v.Occupant.Parent)) -- As the Occupant value is the Humanoid, inside of character (v)
end
end
if #players > 0 then
workspace.RoadLane1.CarTP.SurfaceGui.Frame.Status.TextColor3 = Color3.fromRGB(255, 0, 0)
workspace.RoadLane1.CarTP.SurfaceGui.Frame.Status.Text = "TELEPORTING"
workspace.RoadLane1.CarTP.DetectorScript.Disabled = true
for i, v in pairs(players) do
game.ReplicatedStorage.HideExitGUI:FireClient(v)
end
for i = 0,150,1 do -- Change 30 to number of studs
script.Parent:TranslateBy(script.Parent.Hitbox.CFrame.lookVector)
wait(0.01)
end
local teleportOpt = Instance.new("TeleportOptions")
teleportOpt.ShouldReserveServer = true
for i, v in pairs(players) do
local teleportData = {
Endings = v.leaderstats.Endings.Value
} -- Data that I want to teleport
teleportOpt:SetTeleportData(teleportData)
end
SafeTele(9122217604, players, teleportOpt)
for i = 0,150,1 do -- Change 30 to number of studs
script.Parent:TranslateBy(-script.Parent.Hitbox.CFrame.lookVector)
wait(0.01)
end
workspace.RoadLane1.CarTP.PlrInCar.Value = 0
workspace.RoadLane1.CarTP.DetectorScript.Disabled = false
end
end
Here is the video if you need more info about the problem
robloxapp-20240118-1927069.wmv (2.9 MB)