basically i have a minigames, and this script hits everytime for everyplayer, it gets the part and the part position even when the player doesn’t teleport. theres no errors, roblox just randomly decides that even though the character hasnt died and isnt loading, etc, no issues literally no reason for a character to not teleport, it hits this code, and yet still decides that roblox isnt gonna teleport the character rarely
i print out sp.name and position every time right before it loops tps each player, and everytime it prints the parts position and name, and characters name and i even have it do an insane amount of checks before hand to make sure character isnt dead and or isnt loading and anything else, so everytime even when it fails to teleport, its not because of the character not existing or having the wrong character, its not because i dont got a position or got the wrong position/part, its none of those, roblox just decides that 1-5 percent of the time, code that works perfectly find and has no reason to not work, is just gonna not work, please help, this is actualy insane and making me not want to do anything with roblox anymore despite how much effort ive put in
all of these print exactly what there supposed to each time, basicly these prints and the code above are in a loop, looping through all players to yk tp the player to the game, however despite it having all the right info, and tping everyone perfectly fine, it still decides even with al the right info and even being loopped tped itss just randomly not gonna tp a player rarly, even when the tp doesnt tp player to map it prints all this and those prints are right before the tp code above
First make sure the character is there. if not “return” the code this will stop execution. second your repeat statement is not good. it checks for a specific cframe. which will never really happen unless the player is anchored and has platform stand on
what id do is this: im coding this in browser so sorry if the spacing is bad
local Players = game:GetService("Players")
local function TeleportPlayers(PartToTeleportTo)
if not PartToTeleportTo then
warn("No part was given to teleport to")
return -- stop rundsd of code
end
for _, Player in Players:GetPlayers() do -- this runs for every player
local Character = Player.Character
if not Character then
print("player does not have a character")
return
end
local PrimaryPart = Character.PrimaryPart
if not PrimaryPart then
print("player does not have a primary part")
return
end
PrimaryPart.CFrame = PartToTeleportTo.CFrame * CFrame.new(0, 3.5, 0) -- set the player 3.5 studs above the part facing the lookdirection of the part
end
end
end)
the code i got works perfectly, even withought the loop, honestly you guys can just assume i got 1 line of code setting the characters positon no loop needed, even with loop it works the same, ive tried exactly what u have and i do have an insane amount of checks, like 3 different or 4 different checks just to make sure the player is 100 percent not dead or loading
basicly the glitch, is assume a character is sitting in lobby, hasnt died at all isnt loading. and therfor should beable to be tped with that 1 line of code, but for some reason a tiny percent of the time, even tho it prints, teleporting plr name, aswell as the part there tping to and the position, it still decides to not tp the player
and yes, the character is there, when it fails, the character hasnt died recently, isnt loading,i even put hella checks to make sure of that and it those checks every time without fail, yet it decides to not teleport the character whether i loop it or not, very rarly
and yes ive legit sat there and watched a player that has 0 reason to not teleport (ex: character being dead, or root part not existing, character loading), not teleport, for literaly no reason and i look and all the prints printed what they needed, even withought loop or with loop, it decides to not tp, however the loop works perfectly atlast from what ive seen or the same atleast, no glitches with it
ive told you the problem, you do what you want. deny it. the way you check isnt correct i cant do more then explain it to you or give you a good solution.
u didnt give me the problem buddy ty for trying tho, however ive done exactly what you have and explained that ur reasonings arnt related to the bug at all
like i said the loop isnt the problem buddy, i can tell u have lots of experience, bug stil happens with or withought the loop, the loop has never gotten stuck or even rlly caused anything to work diff
like i said buddy i already check for health among anything else u can think of, and even before i added the loop the bug still happened the loop didnt change anything so like i said just assume its just the 1 line of code loop makes no differance, and no its nothing above the code cause like i said it always hits the code i showed, with all the info needed therfore its nothing above the code ty for ur time tho buddy
my boi i ve just had to repeatdly tell u that what ur saying has got nothing to do with what im saying, and if u actualy ready all my yapping you would see that, however if u cant take the time to read and understand a question and all the variables plz dont respond or act like what u say is law and only right when its not and only takes a little common sence to see that, good for you buddy making videos and misinforming ppl probly
sure check out my tutorials or games, if i didnt know what i was doing then i wouldnt make them or try to help you with your problem but in turn your toxic.
no im good on ur tutorials buddy, u tried to help i apreciate that i just stated that wasnt the problem as if u actualy read what i said, u would see, that your info has nothing to do, nor would help any with my situtation as ive already tried/done and or am currently doing what u asked, but rather then saying oh mb i didnt see that no gotta tell me idk what im talking ab even tho im literaly the one with the problem and all the info, and that your right and im wrong because u have ur little 21 subs youtube channel, so no ur toxic, your not god bro get off ur highhorse