So I have been trying to make a hand to GUI but I don't know how to detect the current item the person holds and to fire the server to transfer that item? Could anyone just tell me where to start looking or something like that?
COMMUNITY QUESTION
Could anyone hint towards a solution for a hand to gui?
1 answer
-- local script
local textbox = script.Parent -- yes put this local script in a textbox
local remote = game:GetService("ReplicatedStorage"):WaitForChild("Give") -- put a remote event in replicated storage and name it "Give" with no speech marks
textbox.FocusLost:connect(function()
remote:FireServer(textbox.Text)
end)
-- server
local remote = game:GetService("ReplicatedStorage"):WaitForChild("Give")
remote.OnServerEvent:connect(function(plr,name)
local plr2 = game:GetService("Players"):FindFirstChild(name)
if plr2 then
local tool = plr.Character:FindFirstChildOfClass("Tool")
if tool then
tool.Parent = plr2.Backpack
end
end
end)
so , to use this is to get a tool ( make sure its equipped ) then put local script in a textbox and then put a player name in it and press enter yes. then boom. ( i havent tried this out so no idea if it works lol )
1 comment
0
ok it works, i just checked lol
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Do you mean like, if you equip the item, a GUI shows up?
No. One of those cafe things. How do I give the item...