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

My teleport to other base script is working, but it only shows one player at a time. Why? (fixed)

Asked by 2 years ago
Edited 2 years ago
local num = 0

local Player = game.Players.LocalPlayer

local otherbuttons1 = game.Workspace.Tycoons:WaitForChild(Player.Name)
wait(1)
local otherbuttons = otherbuttons1.OtherBase.SurfaceGui.TP.otherbuttons
local button = game.Workspace.Tycoons[Player.Name].OtherBase.SurfaceGui.TP[0]

wait()
while true do
    wait(5)
    num = 0
    local Players = game.Players:GetChildren()
    for i = 1, #Players do
        otherbuttons:ClearAllChildren()
        wait()
        local player = Players[i]
        wait()
        local buttonclone = button:Clone()
        buttonclone.Parent = otherbuttons
        buttonclone.Name = num
        buttonclone.Position = otherbuttons[num].Position + UDim2.new(0,0,100,0)
        buttonclone.OwnerV.Value = player.Name
        buttonclone.Owner.Text = player.Name

        buttonclone.BackgroundTransparency = 0
        buttonclone.Owner.TextTransparency = 0

        num += 1
    end
end

THIS IS A LOCAL SCRIPT AND LOCATED IN STARTERPLAYERSCRIPTS. IT WORKS, BUT ONLY ONE PLAYER (THE NEWEST PLAYER THAT JOINED IN THE SERVER) POPS UP ON THE SCROLLING GUI.

This script is supposed to show all the players inside of a scrolling gui, so when you click on it, it will tp to their base (this script isnt added yet, but it will be.) But for some reason, the newest player that joined only shows up on the board. The board updates every 5 seconds, and I could add a player left function which updates the board when a player leaves.


PICTURE OF THE BUG https://imgur.com/gallery/hv61eyX

0
doesnt a localscript affects one client? AProgrammR 398 — 2y
0
ill try using a script. GuestHacks666 20 — 2y
0
but I wanted to use a local script because I want the board to show up for the player only, since its their base. GuestHacks666 20 — 2y
0
It doesnt work as a script either. Only one player detected on the board GuestHacks666 20 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

NEVER MIND, I FIXED IT. I JUST MOVED CLEAR ALL CHILDREN TO A DIFFERENT PLACE.

Ad

Answer this question