Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why is my Teamchanging/Teleportation loop malfunctioning?

Asked by 7 years ago

This is the main script for my first game project. Everything works fine up until the changing teams and teleportation/section. When play testing in a local server everything seems to be in order, however when I bring a friend in to test in play mode only I am teleported and teamchanged. Thank you for your help! :)))

01game.workspace.players.playersIngame.Changed:connect(function(initialstart)
02    wait (5)
03    local playersIngame = game.workspace.players.playersIngame.Value
04    local children = game.Players:GetChildren()
05        if playersIngame >= 2
06        and playersAlive == 0 then
07        print ('The first game needs to be started')
08            workspace.mapsIngame:ClearAllChildren()
09            print ('First round initialized')
10            wait (initaltime)
11                print ('Loading new map')
12                for i,v in pairs(Maps) do
13                if randomMap == i then
14                storage = game:GetService('ReplicatedStorage')
15                local map = storage.Maps:WaitForChild(v):Clone()
View all 36 lines...
0
2 questions, what exactly is players.PlayersIngame? Also lines 20 and 26 and 28 look suspicious to me. Bellyrium 310 — 7y
0
That's two of the exact question... -_-, To me it's a IntValue or NumberValue with a value of the current players in the game. thesit123 509 — 7y
0
v.Character.Head.Cframe = ... instead of v.Character.Torso.CFrame = ... at line 27 its because you are r6 and your friend is r15 you can also chang your game settings to morph to r6 mattchew1010 396 — 6y
0
you can get this to work with r15 and r6 you'd probably use something like [if v.Character:FindFirstChild("Torso") or v.Character:FindFirstChild("LowerTorso") then] mlgwinners 30 — 6y

Answer this question