✓ Accepted answer
local GUI = script.Parent
local button = GUI.Button
local textbox = GUI.TextBox
local remote = game.ReplicatedStorage.Remote
button.MouseButton1Down:Connect(function()
for i,v in pairs (game.Players:GetPlayers()) do
if v.Name == textbox.Text then
remote:FireServer(v, rank)
end
end
end)
local remote = game.ReplicatedStorage.Remote
remote.OnServerEvent:Connect(function(p, playerToGive)
if p.Rank == "Cashier" then
if playerToGive ~= "" then
local tool = game.ReplicatedStorage.Tool:Clone()
tool.Parent = playerToGive.Backpack
end
end
end)
2 comments
The things you need is the button to open the Hand-To GUI. Have a textbox, have a "give" button somewhere on the GUI. Now for this part you will to use in pairs to check in Players if the name the cashier typed in is on the PlayerList, if it is, fire a remote like this, "remote:FireServer(playerToGive). Then you can clone the tool in on server
I dont think that was a good explanation so i'll make a simple overview of the script