Note: This is in a PlayerAdded function. Note: The UserId is mine. Note: Game is FE.
For some reason, when another player joins, it shows the message but does not kick them, it also does not Destroy the gui.
if player.UserId ~= 27621739 then
player:Kick('The game currently is being updated. We are kicking non-developers to prevent you from seeing something unfinished. Check back later, thanks.')
player.PlayerGui:WaitForChild('Main'):Destroy()
end
Whole script:
local Data = game:GetService('DataStoreService'):GetDataStore('StatsData')
local Data2 = game:GetService('DataStoreService'):GetDataStore('Data2')
local Prefix = 'user_'
local repStorage = game:GetService('ReplicatedStorage')
--//Remotes
local datastoreRemote = repStorage.DatastoreRemote
game.Players.PlayerAdded:connect(function(player)
--// Player's Stats
local Folder = Instance.new('Folder',player)
Folder.Name = 'Leaderstats'
local Credits = Instance.new('IntValue',Folder)
Credits.Name = 'Credits'
if player.UserId ~= 27621739 then
player:Kick('The game currently is being updated. We are kicking non-developers to prevent you from seeing something unfinished. Check back later, thanks.')
player.PlayerGui:WaitForChild('Main'):Destroy()
end
--// Discord API
if player.UserId ~= 27621739 or player.Name ~= 'Player1' then
local url = "blehhh"
local http = game:GetService("HttpService")
local HookData = {
['username'] = player.Name,
['content'] = 'joined Project Shift'
}
HookData = http:JSONEncode(HookData)
http:PostAsync(url, HookData)
end
--// Loading Data
local plrData = Data:GetAsync(Prefix ..tostring(player.UserId))
if player.UserId == 93794951 then
if plrData then
Credits.Value = plrData[1] or 20000
end
else
if plrData then
Credits.Value = plrData[1] or 0
end
end
Credits.Changed:Connect(function()
local url = "blahhhhckedd"
local http = game:GetService("HttpService")
local HookData = {
['username'] = player.Name,
['content'] = 'credits changed to: ' ..Credits.Value
}
HookData = http:JSONEncode(HookData)
http:PostAsync(url, HookData)
end)
end)
--// RemoteEvent(Saving Car that player picked)
datastoreRemote.OnServerEvent:Connect(function(player,carPicked)
Data2:SetAsync(Prefix ..tostring(player.UserId),{carPicked})
end)
game.Players.PlayerRemoving:connect(function(player)
local Credits = player.Leaderstats.Credits
--// Saving Data
Data:SetAsync(Prefix..tostring(player.UserId), {player.Leaderstats.Credits.Value})
end)

2 comments
Can we see the entire script? Or whichever part pertains to this?
Sure