So I'm trying to make a tool equip when a GUI button is pressed while the default backpack GUI is disabled. I got the backpack GUI disabled now all I need is the tool equipper
I've tried this
local UserInput = game:GetService("UserInputService") local Player = game:GetService("Players").LocalPlayer local Character = Player.Character or Player.CharacterAdded:wait() local Tool = game:GetService("ReplicatedStorage").PL42 UserInput.InputBegan:connect(function(Input) script.Parent.Buttons.Frame.TextButton.MouseButton1Click:Connect(function() wait(1) Tool.Parent = Character end) end)
and it literally did nothing, can someone help?
ISSUES
You don't need the UIS to activate a GuiButton
Tools go into the player's Backpack to be transferred to the player Character, not directly to the character
Use Activated
since it works for all devices while MouseButton1Click
does not.
Revised Local Script
local Player = game:GetService("Players").LocalPlayer local Tool = game:GetService("ReplicatedStorage"):WaitForChild("PL42") script.Parent.Buttons.Frame.TextButton.Activated:Connect(function() wait(1) Tool.Parent = Player.Backpack end)
local UserInput = game:GetService("UserInputService") local Player = game:GetService("Players").LocalPlayer local Character = Player.Character or Player.CharacterAdded:wait() local Tool = game:GetService("ReplicatedStorage").PL42 UserInput.InputBegan:connect(function(Input) script.Parent.Buttons.Frame.TextButton.MouseButton1Click:Connect(function() Tool.Parent = Player.Backpack wait() Tool.Parent = Character end) end)
this worked for me but idk if they fixed it or not