I am trying to make a local script to add a tool in your back pack when I click a button. When I run my script, and spawn in, I get nothing when I click. Why? Here is my script.
local StarterGui = game:GetService('StarterGui')
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character.Humanoid
local WEAPON = Player.Backpack['M16']
local HumanoidRootPart = Character:WaitForChild('HumanoidRootPart')
local GotGun = false
local btn = game.StarterGui.ScreenGui.Frame.TextButton
btn.MouseButton1Click:Connect(function()
if GotGun == false then
Humanoid:EquipTool(WEAPON)
GotGun = true
end
end)
if Humanoid.Health == 0 then
Humanoid:UnequipTools()
GotGun = false
end

2 comments
wait do u have discord? i kinda wanna carry our converstation there cuz i got a change of plans
sorry for the late reply, I don't check this site often. It's bdam#1716