#help

44 messages · Page 1 of 1 (latest)

maiden plover
#

what

#

um

#

i dont get what you want

#

do you mean the shutdown server thing

#

well you can just make the game private

#

what

#

i still dont get

#

oh

#

well yeah but i dont see the point

#

but anyway

#

i think you can do player:kick() or something

#

lemme check

#

yeah

#
game.Players.PlayerAdded:Connect:function(player)
  local reason = "{insert reason for kick here}"
  local Time = --{insert time in seconds before kicking}
  
  task.wait(Time)
  player:Kick(reason)
#

i think that should work

#

yes lemme give an example

#
game.Players.PlayerAdded:Connect:function(player)
  local reason = "intentional feature dont question"
  local Time = 60
  
  task.wait(Time)
  player:Kick(reason)
#

so in this case

#

one minute (60 secs) after joining, you are kicking and the reason is "intentional feature dont question"

#

wdym

#

like the very first time you join it waits but then the second time you join its instant?

#

oh then you need to data store

cinder talon
#

studio** You are now Level 4! **studio

maiden plover
#

not necessarily

#

you could make it one if you wanted to

#

but usually its just a value

#

one sec

#

ima modify rq

#

so im done

#

but it might not work

#

properly the first time

#

becauyse i copied most of it from another game i did

#

and just changed the values

#

but

#
local ds = game:GetService("DataStoreService")
local DataStoreOne = ds:GetDataStore("DataStore")


game.Players.PlayerAdded:Connect(function(player)
    
    local HasJoinedBefore = Instance.new("BoolValue", player)
    HasJoinedBefore.Name = "HasJoinedBefore"
    
    local playerID = "PlayerNum_*_" .. player.UserId
    local data
    
    local success, errormessage = pcall(function() 
        data = DataStoreOne:GetAsync(playerID)
    end)
    
    if success then
        HasJoinedBefore = data.HasJoinedBefore
        
    else
        warn(errormessage)
    end
    
    if HasJoinedBefore then
        player:Kick("reason")
    else
        task.wait(60)
        player:Kick("reason")
    end
    
end)

game.Players.PlayerRemoving:Connect(function(player)
    
    local playerID = "PlayerNum_*_" .. player.UserId
    local data = {
        HasJoinedBefore = player.HasJoinedBefore
    }
    
    local success, errormessage = pcall(function()
        DataStoreOne:SetAsync(playerID, data)
    end)
    
    if not success then warn(errormessage) end
    
end)
#

wait oops

#

nvm that wont work

#

i forgot about the kicking thing itself

#

updated

#

@cinder talon try now

#

ok

#

also

#

change the reason and time to your liking

#

i did 60 and "reason"