|
| 23 Jan 2014 05:12 PM |
Should I use :Kick() to remove them from the game, or teleport them to another place? What are pros or cons of doing one or the other? I mean... If I'm kicking them might as well send them to a blank place and earn a little extra ;3 |
|
|
| Report Abuse |
|
|
Desight
|
  |
| Joined: 19 Apr 2012 |
| Total Posts: 4087 |
|
|
| 23 Jan 2014 05:15 PM |
Haha, good idea. But make sure that if it fails to tp them, it just uses :Kick(). |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2014 05:21 PM |
Good idea, since the teleport service needs their character and not their Player object (In Game.Players) it wouldn't teleport them if their character was removed... I think? |
|
|
| Report Abuse |
|
|
Desight
|
  |
| Joined: 19 Apr 2012 |
| Total Posts: 4087 |
|
|
| 23 Jan 2014 05:31 PM |
| Well, you can easily re-spawn a character for them. |
|
|
| Report Abuse |
|
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 23 Jan 2014 05:37 PM |
| The problem with using TeleportService is that it wouldn't be instant, so therefore if they were exploiting you would likely have to put up with them doing something or another whilst ROBLOX screams at them that they're being teleported. Also, since the majority of them have elevated permissions when running things, they could quite simply use the "CancelTeleport" method, if it still works. |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2014 05:38 PM |
Thats true, but you can't do it while they are still loading into the game
Example (This isn't the full script but its the part that kicks people) Game.Players.PlayerAdded:connect(function(NewPlayer) if BlackListed(NewPlayer) then ypcall(function() Game:GetService("TeleportService"):Teleport(128877709, NewPlayer.Character) NewPlayer:Kick() end) end end)
That will always :Kick() them not teleport |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2014 05:39 PM |
@Data Well they could also RobloxLock them and :Kick() wouldn't work anymore |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2014 05:42 PM |
I kinda wish Kick() could be used like
Player:Kick("Reason")
And instead of "This game has shutdown" it would say "Reason" |
|
|
| Report Abuse |
|
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 23 Jan 2014 05:45 PM |
I believe ":Kick()" does work on RobloxLocked players, however I may be wrong.
Also, regarding your script - Yes, it would kick them. Teleporting isn't instantaneous like kicking, and takes several seconds before it would actually teleport them. Also, you have the issue of the fact that when the "PlayerAdded" event fires, it's not guaranteed their character is also loaded. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Jan 2014 05:47 PM |
| ^ It does work on RobloxLocked (last time I checked) |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2014 05:48 PM |
It doesn't work on roblox locked players, Someone said so a while back, so they might have changed it Anyway
This doesn't work and I don't understand why It works if I make it kick instead of teleport (I commented out the kick part) (and the ypcall as a test)
Game.Players.PlayerAdded:connect(function(NewPlayer) if BlackListed(NewPlayer) then NewPlayer.CharacterAdded:connect(function(Kick) --ypcall(function() Game:GetService("TeleportService"):Teleport(128877709, Kick) --NewPlayer:Kick() --end) end) end end) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Jan 2014 05:49 PM |
"It doesn't work on roblox locked players, Someone said so a while back" It always worked since it came out, that person doesn't know much. It just doesn't work when the player's parent is nil |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2014 05:51 PM |
Alright my bad, I got some bad information from someone I guess, Can you tell me why its not teleporting? The BlackList() function works fine, because the script worked fine when I made it kick them |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Jan 2014 05:52 PM |
| Because the character is most likely nil at the time |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Jan 2014 05:53 PM |
Oh never mind, I only read the first script.
What is the BlackListed function? |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2014 05:53 PM |
"NewPlayer.CharacterAdded:connect(function(Kick)" Wouldn't that wait till it has a character? Anyway I guess I should just use :Kick() for the BlackList But teleport for the kick/ command, since they would have already been in the place and messing with it anyway |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2014 05:54 PM |
function BlackListed(Player) for _, Name in pairs (BlackList) do if Name:lower() == Player.Name:lower() then Log(Player.Name .. " is banned (BlackList type: Name") return true end end
for _, UserID in pairs (BlackListID) do if tonumber(UserID) == Player.userID then Log(Player.Name . " is banned (BlackList type: UserID)") return true end end return false end |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Jan 2014 05:56 PM |
I'll assume BlackList is a table.
Player.userId* is 1 error |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2014 05:58 PM |
Oh, thanks Yes its a table I added wait(5) before teleporting them, and it worked So, I'll just use Kick() Thanks everyone
I think I'll still teleport them with the kick/ command |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2014 06:04 PM |
Would this cause problems?
if WhiteListed(NewPlayer) then NewPlayer.Chatted:connect(function(Input) Spoke(Input, NewPlayer) end) end
Because "NewPlayer" would change when someone new enters the game, right? So Spoke(Input, NewPlayer) wouldn't work, or am I wrong? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Jan 2014 06:05 PM |
| No, it's a local variable in the anonymous function's scope. |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2014 06:08 PM |
Alright thanks, one more thing Im going to make it so if the script gets disabled, it gets enabled So would this work to auto connect everyone back?
Game.Players.PlayerAdded:connect(function(NewPlayer) CheckPlayer(NewPlayer) end)
for _, Player in pairs (Game.Players:GetPlayers()) do CheckPlayer(Player) end
CheckPlayer() is just everything that was in my PlayerAdded function stuck into another function |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Jan 2014 06:09 PM |
| yeah that should work fine |
|
|
| Report Abuse |
|
|