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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 27 Jul 2015 11:48 AM |
| does the ban script loop through a table? if so you can use table.insert |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 27 Jul 2015 12:03 PM |
| Insert the string value of the playername into that table using table.insert |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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 |
|
|