generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Pushing up positions

Previous Thread :: Next Thread 
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
19 Apr 2015 10:16 AM
So I'm using a script that someone gave me and and I've edited it:

local frame = script.Parent
local num = frame.Players
local template = frame.Player0
for i,player in pairs(game.Players:GetPlayers()) do
if player then
num.Value = num.Value + 1
local slotnum = num.Value
local slot = template:Clone()
slot.Parent = frame
slot.Name = "Slot"..slotnum
slot.Position = UDim2.new(0,0,0.05 * num.Value, 0)
slot.Text = player.Name
slot.Visible = true
end
end
function Joining(player)
num.Value = num.Value + 1
local slotnum = num.Value
local slot = template:Clone()
slot.Parent = frame
slot.Name = "Slot"..slotnum
slot.Position = UDim2.new(0,0,0.05 * num.Value, 0)
slot.Text = player.Name
slot.Visible = true
end
function Leaving(player)
for i,label in pairs(frame) do
if label then
if string.find(label.Name,"Slot") then
if label.Text == player.Name then
label:Destroy()
num.Value = num.Value - 1
end
end
end
end
end
game.Players.PlayerAdded:connect(Joining)
game.Players.PlayerRemoving:connect(Leaving)


But when someone leaves, it leaves a gap and then when someone joins, it puts their name on someone else and leaves that gap open
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
19 Apr 2015 10:27 AM
b
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
19 Apr 2015 10:35 AM
Just tell the script to put the next open spot with a player name

if textbox = empty then
textbox.text = player.name
end

lold thats the general idea
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
19 Apr 2015 10:39 AM
thanks!
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
19 Apr 2015 10:49 AM
And how would I check the textlabel below it though
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
19 Apr 2015 10:54 AM
B
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
19 Apr 2015 11:07 AM
I mean like, how would I set the empty text label to the players name thats in the slot beneath and then set the player beneath the next empty slot to that slot?
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
19 Apr 2015 12:25 PM
^^^
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
19 Apr 2015 12:54 PM
b
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
19 Apr 2015 12:59 PM
Game.Forum.Scripters.PostHelp(true)
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
19 Apr 2015 01:32 PM
print "bump"
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
19 Apr 2015 01:55 PM
Change the names to numbers, top being 10, bottom being 1, then do below=current-1
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
22 Apr 2015 01:03 PM
And how would I do a for loop to change positions of everything thats below the one above?
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
22 Apr 2015 01:49 PM
b
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
24 Apr 2015 02:56 PM
B
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
25 Apr 2015 06:38 AM
This is my code so far:

This is what I'm working on

function Leaving(player)
local slotnum = num.Value
local below = nil
local belowall = nil
local current = nil
local bottom = 1
local above = nil
local top = 10
for i,label in pairs(frame) do
if label then
if string.find(label.Name,""..slotnum) then
if label.Text == player.Name then
current = label.Name
below = current - 1
above = current + 1
for i in pairs (frame) do
if string.find(label.Name,""..slotnum) <= below then
belowall = top - slotnum
for string.find(label.Name,"")
end
end
label:Destroy()
num.Value = num.Value - 1
end
end
end
end
end
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
25 Apr 2015 06:38 AM
I'm stuck on the for loop that finds all the slots beneath the one that got removed
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
25 Apr 2015 06:59 AM
http://wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
25 Apr 2015 07:08 AM
That's not helping ^^^
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
25 Apr 2015 07:23 AM
we dont make 1337 scripts for free, noobcaik
Report Abuse
InedibleGames is not online. InedibleGames
Joined: 27 Apr 2014
Total Posts: 1140
25 Apr 2015 07:58 AM
Funny :/
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image