Hey, so basically i want to have a working inventory system where players can press a button. For example “V” and if the tool is equipped whilst that button is pressed then the tool will be stored in the inventory.
Note: I have a working inventory system all i want help with is making it so when “V” is pressed the parent of set to a folder named Inventory inside of the player.
Currently my script inside the tool is:
local Item = script.Parent
local UserInputService = game:GetService("UserInputService")
local function OnInputBegan(input, Player)
if input.UserInputType == Enum.KeyCode.V then
print("Input Worked")
Item.Parent = Player:FindFirstChild("Inventory")
end
end
UserInputService.InputBegan:Connect(OnInputBegan)```
local Item = script.Parent
local UserInputService = game:GetService("UserInputService")
local function OnInputBegan(input, Player)
if input.UserInputType == Enum.KeyCode.V then
if Player.Character and Player.Character:FindFirstChild("toolname ") then
print("Input Worked")
Item.Parent = Player:FindFirstChild("Inventory")
end
end
end
UserInputService.InputBegan:Connect(OnInputBegan)
i’m on mobile so the formatting might be messed up
Hey, yeah around 20 minutes ago i began re reading the documentation until i realised it doesnt work in scripts so i have re wrote all of my script to fit for the local version.