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 » Scripting Helpers
Home Search
 

Re: How would i....

Previous Thread :: Next Thread 
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Feb 2013 07:36 AM
Make it so if i say for example ban/fed the player get banned, ik the chat part but not the ban.I know its something about table.insert the variable v in this script to the banned table and ban everyone inside it but idk how the row is gona be and mine will probaly error.Anyway heres the script with that chat part i talked about:

banned = {}

game.Players.Fedorakid.Chatted:connect(function(msg)
if msg:lower():sub(1,5) == "kill/" then
for _,v in pairs(game.Players:GetPlayers() do
if string.match(string.lower(v.Name), string.lower(string.sub(msg, 6))) then
--BANHERE
end
end
end
end)


P.S this shouldnt so advanced, the script is alittle advanced but in the ban place. AND REMEMBER V IS THE VARIABLE FOR THE PLAYER I SAY.
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
13 Feb 2013 07:52 AM
Best solution (in my opinion):

--------------------------------------------------------------

Make a LocalScript with this source:
Instance.new("ManualSurfaceJointsInstance", script.Parent)


then, replace --BANHERE with.. hm.. (Assume the LocalScript is a child of the Script, and it's Disabled and have it's name called "BanScript")

banned[tostring(v)] = true
local banYay = script.BanScript:clone()
banYay.Parent = v:FindFirstChild("PlayerGui")
banYay.Disabled = false

and at the end of the script:
game:service("Players").PlayerAdded:connect(function(newPlayer)
if banned[tostring(newPlayer)] then
local banYay = script.BanScript:clone()
banYay.Parent = newPlayer:FindFirstChild("PlayerGui") -- May fail if PlayerGui is loaded after the player.
banYay.Disabled = false
end end)

--------------------------------------------------------------

Sorry if the script don't work, I haven't tested it... I'm too lazy to open a game in server.rbxl mode and crash it, sry.

- As
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Feb 2013 09:02 AM
bump
Report Abuse
mic144 is not online. mic144
Joined: 14 Oct 2009
Total Posts: 1598
13 Feb 2013 09:20 AM
banned = {}

game.Players.Fedorakid.Chatted:connect(function(msg)
if string.sub(msg,1,5) == "kill/" then
for _,v in pairs(game.Players:GetPlayers() do
if string.match(string.lower(v.Name), string.lower(string.sub(msg, 6))) then
--BANHERE
end
end
end
end)
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Feb 2013 09:26 AM
Did you even read the thread? my script works so its not broken but how would i ban someone and as i said, the player i chat ban's name is v.
Report Abuse
mic144 is not online. mic144
Joined: 14 Oct 2009
Total Posts: 1598
13 Feb 2013 09:39 AM
banned = {}

game.Players.Fedorakid.Chatted:connect(function(msg)
if msg:lower():sub(1,5) == "kill/" then
for _,v in pairs(game.Players:GetPlayers() do
if string.match(string.lower(v.Name), string.lower(string.sub(msg, 6))) then
game.Players(string.sub(msg, 6)):Destroy()
end
end
end
end)

??
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Feb 2013 09:41 AM
That will kick not ban or else the table wouldnt be there and u didnt read my whole last post AGAIN because the ban line u wrote could just be

v:Destroy, EASY LIKE THAT v is the variable for the player's name i say.
Report Abuse
mic144 is not online. mic144
Joined: 14 Oct 2009
Total Posts: 1598
13 Feb 2013 09:50 AM
table.insert(yourbantablename, v)
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Feb 2013 09:54 AM
Thank you that was very helpful saying the same as wiki but changing the names.

Bump.
Report Abuse
mic144 is not online. mic144
Joined: 14 Oct 2009
Total Posts: 1598
13 Feb 2013 09:57 AM
Thats how you could get them banned. Adding them in the banned table. If you want to learn how to make the players in the table get bannedthe just say so :0
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Feb 2013 10:00 AM
Like i said, a ban line not inserting to a table line.Would it be

table.insert(v, banned)
for _,b in pairs(banned)
pcall(function()
b:Destroy()
end
Report Abuse
mic144 is not online. mic144
Joined: 14 Oct 2009
Total Posts: 1598
13 Feb 2013 10:08 AM
You're doing it backwards.. Try table.insert(banned, v[i]) -- maybe the [i] idk how your variableis set up.
Also, for the banning you could try looping it.

for i =1,#banned do
if string.lower(banned[i]) == string.lower(v) then
v:remove() --or destroy your preference..
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
13 Feb 2013 10:15 AM
So this?:

table.insert(v, banned)
for _,b in pairs(banned) do
if string.lower(b) == string.lower(v) then
v:Destroy()
end
end
Report Abuse
mic144 is not online. mic144
Joined: 14 Oct 2009
Total Posts: 1598
13 Feb 2013 10:23 AM
Yes, again try both ways:

table.insert(v, banned)
for _,b in pairs(banned) do
if string.lower(b) == string.lower(v) then
v:Destroy()
end
end

or

table.insert(banned, v)
for _,b in pairs(banned) do
if string.lower(b) == string.lower(v) then
v:Destroy()
end
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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