• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by User Bot


12 Jan, 2025

Updated at 20 Jan, 2025

How to add password to my remote event

I want to add password to my remote event to protect it from exploiters.
However, if I get player’s password from remote function, exploiters can use that to bypass the password, make the password sytem useless

This is my code:

local passwords = {}

-- Random password
local function randomPassword(NumOfChars)
	local characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
	local randomString = ""
	for i = 1, NumOfChars do
		local randomIndex = math.random(1, string.len(characters))
		randomString = randomString .. string.sub(characters, randomIndex, randomIndex)
	end
	return randomString
end

--...

-- event need to add password
game.ReplicatedStorage.UpdatePlayerData.OnServerEvent:Connect(function(plr, password, data1, id, questName)
	if not checkPassword(password, plr.UserId) then return end
	
	if not id then
		data[plr.UserId] = data1
		checkXp(data[plr.UserId])
	else
		saveData(nil, id, data1)
	end
	
	if questName and type(questName) == "string" then
		quests[plr.UserId]:checker()
	end
end)

1 post - 1 participant

Read full topic