Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[SOLVED] I am Stuck on Making Hand-to GUI for my Roleplay Group?

Asked by 4 years ago
Edited 4 years ago

I am trying to make one of those big roleplay groups and I need a Hand-to GUI so cashiers can give the customers their food.

I would at least try this but I have absolutely no idea how to even start. Be aware this is not a request I would just like some help on how to make it.

0
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 Delude_d 112 — 4y
0
I dont think that was a good explanation so i'll make a simple overview of the script Delude_d 112 — 4y

1 answer

Log in to vote
1
Answered by
Delude_d 112
4 years ago
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)

-- Server
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)

-- I added that extra rank if statement so exploiters cant abuse this
1
woops i was meant to type remote:FireServer(v) not remote:FireServer(v, rank) Delude_d 112 — 4y
0
Thanks I will try this out and accept as answer if it works. PrismaticFruits 842 — 4y
Ad

Answer this question