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: DataStore Totally Broke..? :C

Previous Thread :: Next Thread 
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 12:57 PM
--Would post datastore part but roblox hashtags it out so here:

local kerr = ('server-'..game.PlaceId)
local kickr = {
"newcoolman2",
"Player2",
}

function start()
if DataStore:GetAsync(kerr) ~= nil then
kickr = DataStore:GetAsync(kerr)
else
DataStore:SetAsync(kerr, kickr)
end
end
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 12:58 PM
I had to make it a function because it holds all the other code under it, like a player added and etc... from completely working..!
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 01:05 PM
plz
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 01:10 PM
b
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 01:14 PM
Why no help?


My new siggy; c(ˆ▿ˆc)
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
31 Jan 2017 01:14 PM
http://wiki.roblox.com/index.php?title=Data_store#Tables_with_mixed_list_.2F_record_style_will_be_cut_off
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 01:16 PM
Try to save names... what would you recommend... :C
Report Abuse
C_Sharper is online. C_Sharper
Joined: 03 Oct 2011
Total Posts: 6405
31 Jan 2017 01:33 PM
############################################################################# ^.^
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 01:36 PM
local kickr = {
[1]="newcoolman2",
[2]="Player2",
}


game.Loaded:connect(function() --easy fix
if DataStore:GetAsync(kerr) ~= nil then
kickr = DataStore:GetAsync(kerr)
else
DataStore:SetAsync(kerr, kickr)
end
end)

That works but now: doesn't work

game.Players.PlayerAdded:connect(function(plr)

if plr and kickr[plr.Name] == nil then --if player is in the table.

else

plr:kick()

end
end)
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 01:40 PM
Hey look, roblox didn't turn the entire post to hashtags... again...
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 01:49 PM
Wow, my 'new' siggy lasted like 3 posts...
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
31 Jan 2017 01:50 PM
You need to review how tables work.
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 01:51 PM
I really do... :C
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 01:59 PM
@Casual

http://wiki.roblox.com/index.php?title=Table#Pass_by_reference

That's what I'm doing...

Table[ObjectName]...

Should I do numbers, because I don't want to loop through every time a player joins.

local kickr = {
[1]="newcoolman2", --my table
[2]="Player2",
}
Report Abuse
Kutoru is not online. Kutoru
Joined: 22 May 2016
Total Posts: 288
31 Jan 2017 02:03 PM
try JSONEncode
i didn't read anything
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 02:03 PM
b
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
31 Jan 2017 02:05 PM
https://forum.roblox.com/Forum/ShowPost.aspx?PostID=201595803
https://www.roblox.com/library/618161558/Basic-DataStore-Example


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
31 Jan 2017 02:09 PM
local banned = {}

game.PlayersAdded:connect(function(player)
local data = ds:GetAsync('BanData')
if (data and data[player.userid]) or banned[player.Name] then player:Kick() end
end


Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 02:58 PM
table.insert(banned,p.UserId)
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 03:01 PM
local data = ds:GetAsync('server;'..game.PlaceId)
if (data and data[plr.UserId]) then print('not allowed') plr:Kick('Banned') end

Doesn't work with @above
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 03:06 PM
:?
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 03:15 PM
b
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
31 Jan 2017 03:28 PM
what do you mean datastore broke? Is the data not saving? or is the problem with your script that utilises the data store to do stuff
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
31 Jan 2017 03:57 PM
--I'm using: --

table.insert(banned,p.UserId)

--this doesn't work with playeradded: --

local data = ds:GetAsync('server;'..game.PlaceId)
if (data and data[plr.UserId]) then print('not allowed') plr:Kick('Banned') end
Report Abuse
BlueWizard12345 is not online. BlueWizard12345
Joined: 31 Mar 2012
Total Posts: 906
31 Jan 2017 04:04 PM
game.Players.PlayerAdded:connect(function(Player)
local Admin = false
for i, v in pairs(kickr) do
if v == Player.Name then
Admin = true
end
end
if Admin then
else
Player:Kick()
end
end)
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