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: Remote Event help

Previous Thread :: Next Thread 
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
17 Sep 2015 09:49 PM
Okay so I'm trying to make a ban script with data stores. Whenever i test online it says Line 29, argument one missing or nil


local event = game.ReplicatedStorage:WaitForChild("RemoteEvent")
local datastoreservice = game:GetService("DataStoreService")
local banliststore = datastoreservice:GetDataStore("MLP3DRPBanlist")

game.Players.PlayerAdded:connect(function(player)
if player:IsInGroup(2656742) then
local rank = player:GetRankInGroup(2656742)
if rank == 255 or rank == 2 then
local modgui = player:WaitForChild("PlayerGui"):WaitForChild("Mod")
modgui:WaitForChild("Framebutton").Visible = true
end
end

local playerid = "user-"..player.userId

local check = banliststore:GetAsync(playerid)
if check then
player:Kick()
end

end)

event.OnServerEvent:connect(function(...)
local tuple = {...}
local playername = tostring(tuple[2])
local banplayer = game.Players:FindFirstChild(playername)
if banplayer then
local playerid = "user-"..banplayer.userId
banliststore:SetAsync(playerid) -- argument two missing or nil
banplayer:Kick()
end
end)
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
17 Sep 2015 09:49 PM
*** I meant Argument 2 missing or nil!
Report Abuse
foreverpower is not online. foreverpower
Joined: 05 Feb 2011
Total Posts: 5578
17 Sep 2015 09:52 PM
First of all, it trusts the client to send a player to ban without verifying if that player has the authority to ban, which means a hacker could abuse this ban any player they wish.

Second, SetAsync takes an argument of a key and a value, so set the value to true.

banliststore:SetAsync(playerid, true)
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
17 Sep 2015 09:55 PM
Thanks and forever power, the script checks to see if a player is in a group and if they are ranked as a moderator. If they are a moderator a button becomes visible for them to click to get the ban gui to show up
Report Abuse
foreverpower is not online. foreverpower
Joined: 05 Feb 2011
Total Posts: 5578
17 Sep 2015 09:56 PM
That would work in theory, but a hacker could still fire the event without having the button displayed on their screen.
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
17 Sep 2015 09:57 PM
It works :D
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
17 Sep 2015 10:29 PM
How would i unban the player now? Like remove them from the datastore?
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
17 Sep 2015 10:30 PM
should i change it from true to false?
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