Press a Button To Respawn a Gear

fixed:

local football = game:GetService("ReplicatedStorage"):WaitForChild("Football")
local btn = script.Parent

local p = game.Players.LocalPlayer

btn.MouseButton1Click:Connect(function()
	football:Clone().Parent = p.Backpack
end)

When I click the button, I still donā€™t get the football

Are there errors in output?

Let me make a model of your game in my own game so I can test.

I am not sending people files to my game. It is already big so I donā€™t want to share files.

I am not asking for a file. Anyways, it works for me.

https://gyazo.com/2983f8fd1e29df20b7091fedb89461a1

Setup:

image

Thatā€™s how mine is. I donā€™t know why its not working for me

test_button.rbxm (5.7 KB)

Upload this into StarterGui.

image

Aha! Thatā€™s the problem!

Your football is in ServerScriptService! Put it in ReplicatedStorage.

1 Like

oooooooooooooooooh I feel so stupid

Iā€™ve tried to find the answer, but I canā€™t seem to find it.
Thank you!

A:

To make it so the player presses a button to put a football in their inventory, you can use the Button1Up event on the button:
local football = ā€“ ball path
local btn = script.Parent

local p = game.Players.LocalPlayer

btn.MouseButton1Up:Connect(function()
football:Clone().Parent = p.Backpack
end)

1 Like

Is there a way to where you can only have 1 at a time and not spam the button for a million footballs?

New issue, now the power bar does not show up and I canā€™t throw the football

You should make the scripts activate once the player equips the tool.

local tool = script.Parent
local p = game.Players.LocalPlayer
local character = p.CharacterAdded:Wait()

repeat
wait()
until character:WaitForChild("Football")

-- code
1 Like

Where would I place this script?

Hmmā€¦ Could you please send me just your football tool, so I can tinker with it easier?

How would I do that exactly???

Right click the tool, ā€œSave To Fileā€, upload it to Dev Forum via this button.
image

RobloxFootball.rbxm (21.4 KB)