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

Why wont this handto script not give the item in my hand?

Asked by 6 years ago
Edited 6 years ago

the script is supposed to give something that in my hand to someone

Button = script.Parent
Player = game.Players.LocalPlayer

function CheckColor()
    if Button.Position.Y.Offset%40 then
        Button.BackgroundTransparency = 0.5
    else
        Button.BackgroundTransparency = 1
    end
end
CheckColor()

Button.MouseButton1Down:connect(function()
    CheckColor() repeat wait() until Player.Character
    for i,v in ipairs(Player.Character:GetChildren()) do if v:IsA("Tool") then Tool = v break end end
    if Tool == nil or game.Players:FindFirstChild(Button.Text) == nil then return end
    if game.Players[Button.Text].Character then
        Tool.Parent = game.Players[Button.Text].Character
    else
        Tool.Parent = game.Players[Button.Text].Backpack
    end

end)

0
You cant do everything in a local script Father_Odin 2 — 6y
2
You would have to do the giving part in a normal script Father_Odin 2 — 6y
0
It is still not working MrGaming4me 28 — 6y

Answer this question