Why this "Hand to" works if i give the item to me, but if i use to another player it doesn't work?
this script is supposed to give a tool to another player when i put the name in a TextGui, but it just works if i put my name, what's wrong?
01 | local playaa = game.Players.LocalPlayer |
03 | repeat wait() until playaa.Character |
06 | local mouse = playaa:GetMouse() |
08 | function FullName(name) |
09 | for _,v in pairs (game.Players:GetPlayers()) do |
10 | if v.Name:lower():match(name:lower()) then |
13 | return "Couldn't find player" |
20 | if playaa:GetRankInGroup( 3613404 ) > 0 then |
27 | if IsWorker() = = true then |
28 | script.Parent.Frame.Visible = true |
31 | script.Parent.Frame.PlaceButton.MouseButton 1 Down:connect( function () |
32 | for _,v in pairs (playaa.Character:GetChildren()) do |
33 | if v:IsA( "Tool" ) and FullName(script.Parent.Frame.CustomerBox.Text) ~ = "nothing" then |
34 | local plr = game.Players:FindFirstChild(FullName(script.Parent.Frame.CustomerBox.Text)) |
36 | v.Parent = plr.Backpack |
39 | local plrgui = Instance.new( "ScreenGui" , plr.PlayerGui) |
40 | local textlabel = script.TextLabel:Clone() |
41 | textlabel.Parent = plrgui |
42 | textlabel.Text = playaa.Name.. " Gave You " ..v.Name |
48 | yut.TextTransparency = yut.TextTransparency + 0.1 |
49 | yut.TextStrokeTransparency = yut.TextStrokeTransparency + 0.1 |