What do you want to achieve? Keep it simple and clear!
I am making a game where you basically guess a players password (NOT REAL ROBLOX PASSWORD A RANDOM ONE MADE UP IN THE GAME) for rewards. My issue is with the minigame in where you guess said password. There is a ui that allows you to guess it but the problem is one of the textlabels need to have the players real password in it.
What is the issue? Include screenshots / videos if possible!
The problem is, I am sending sensitive data (players session password) to the client but I want to know if there is any other way to do it without sending the information to the client.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried to set the players GUI through the server but that did not work.
function SendPasswords(profile, player, realpassword)
if not profile then
print("No Profile")
return
end
if not player then
print("No Player")
return
end
if not realpassword then
print("No Real Password")
return
end
local fakepasswords = passwordGenerator(realpassword, profile)
ShowPassword:FireClient(player, fakepasswords)
end
-- In a different function
GetPasswords.OnServerEvent:Connect(function(PlayerToHackName)
local PlayerToHack = Players:FindFirstChild(PlayerToHackName)
SendPasswords(profile, PlayerToHack, profile.Data.SessionPassword)
end)
Simply don’t send this data to the client until the textlabel actually needs to be shown to them. Is there any other reason the data is being sent to the client immediately aside from displaying it in a textlabel?
what do you mean? I thought you were not able to edit gui from the server. How would I change the text to the real password if I can’t edit it on the server?
It is only sent when a player tries to hack another player and the ui with the buttons for the guessing minigame pops up. (event gets fired) and then recieved on the server. I am having a problem with the next step which would be sending the fake passwords and the actual password for the player to guess to the client so the text could be set for the ui.
I am. I fire an event once everything gets verified on the server when a player tries to hack someone. I just want to know if I should send the real password in that event.
ShowPassword:FireClient(player, fakepasswords) – Should I add it in here?
You should only send the real one to the client once they have correctly guessed the password (if that’s when that textlabel you mentioned should be showing, that is.)
When requested by a hacker (and of course after checking if this is allowed by the game’s logic at that point… otherwise you could enable a DDoS vulnerability haha), sends along a table containing faux-generated passwords with a guarantee to include the target player’s password
Player B (hacker):
Can request for the table created from the server
Handles GUI hydration after the table from the server is received
For the passwords to not be easily recognized by various “hackers” as the game goes on, consider requesting that players change their passwords. This is so that the guarantee that the victim’s password is in a table does not make it easier for the hacker to uncover the password after multiple attempts.
And if you still need help with the presenting of the server-passed information, you should send over some of the rendering/client-side code so we can help with that.
can you explain how I would do that? Here is my client code.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local PlayerGUI = Player.PlayerGui
-- Main GUI
local MainFrames = PlayerGUI:WaitForChild("MainFrames")
local HackingUI = MainFrames.HackingUI
local PlayerList = MainFrames.HackList
-- MainFrames
local PlayerFrame = PlayerList.HackFrame
local MinigameFrame = HackingUI.MinigameFrame
-- Events
local Events = ReplicatedStorage.Events
local GetPasswords = Events.GetPasswords
local Public = {}
local Private = {}
function Public.FindPlayerToHack()
local HackButtons = PlayerList.HackFrame:GetDescendants()
local PlayerToHack = nil
for i, button in ipairs(HackButtons) do
if button:IsA("GuiButton") and button:HasTag("HackButton") then
PlayerToHack = button.Parent.Name
print(PlayerToHack)
button.MouseButton1Up:Connect(function()
GetPasswords:FireServer(PlayerToHack)
end)
end
end
end
return Public