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: If I want to Grab a Player

Previous Thread :: Next Thread 
Botchan is not online. Botchan
Joined: 14 Jun 2015
Total Posts: 269
27 Jul 2015 11:22 AM
local player = script.Parent.Text
game.Players.Ban.PlayerName.Value = [player]

playername is a string value.
Ban is a script.

However, it doesn't function properly.

It probably sounds newbie but I don't know where to go on the wikia either.
Report Abuse
ByDefault is not online. ByDefault
Joined: 25 Jul 2014
Total Posts: 3197
27 Jul 2015 11:24 AM
local plr = script.Parent.Text

game.Players:FindFirstChild(plr):kick()
Report Abuse
Botchan is not online. Botchan
Joined: 14 Jun 2015
Total Posts: 269
27 Jul 2015 11:26 AM
Nononono.

I need the PlayerName which is the stringvalue to have that player's name inserted into it so the ban script can loop through.
Report Abuse
greedyawesomeman is not online. greedyawesomeman
Joined: 18 Apr 2010
Total Posts: 1038
27 Jul 2015 11:48 AM
does the ban script loop through a table? if so you can use table.insert
Report Abuse
Botchan is not online. Botchan
Joined: 14 Jun 2015
Total Posts: 269
27 Jul 2015 12:00 PM
It does:

BanList = {}

while true do
table.insert(script.Parent.Ban.PlayerName.Text)
local plr = BanList
local c = game.Players:GetPlayers()
for i = 1, #c do
if (c[i].Name == plr) then
c[i]:remove()
end
end
wait()
end
Report Abuse
greedyawesomeman is not online. greedyawesomeman
Joined: 18 Apr 2010
Total Posts: 1038
27 Jul 2015 12:03 PM
Insert the string value of the playername into that table using table.insert
Report Abuse
Lolocks is not online. Lolocks
Joined: 22 May 2010
Total Posts: 1355
27 Jul 2015 12:03 PM
You really shouldn't have a ban system working this way. It's both inefficient and, unless your place is filteringEnabled, easily exploitable.

-Lolocks
Report Abuse
Botchan is not online. Botchan
Joined: 14 Jun 2015
Total Posts: 269
27 Jul 2015 12:07 PM
Lolocks. Mind telling me an effectient way? I'm not that much of a professional on scripting. I'm intermediate.
Report Abuse
Lolocks is not online. Lolocks
Joined: 22 May 2010
Total Posts: 1355
27 Jul 2015 12:12 PM
Have a ban script in ServerScriptService with a table. No need for a loop though, have it listening to a RemoteEvent which you can call from your localscript to give the player's name to the ban script. From the ban script, listen to the PlayerAdded event and :Kick() all joining players that are banned - also have it :Kick() the player that it receives from the RemoteEvent as it receives it.

-Lolocks
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