Recently I have been working on a custom pick up method. I used a free model as a template then edited the scripts to suit my needs (pls don't hate xddd). You would go up to the weapon, press Q and the weapon would disappear and you would find it in your inventory. When I go on Studio Test all is fine but once I test a server then I can only see the gui to pick up the item and when I press Q nothing happens. I also made it so the GUI disappears after 3 seconds. After the 3 seconds are gone, the gui disappears and never comes back once i touch the hitbox again.... Does it have to do with Filtering Enabled? How can I fix this issue?
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
tool = script.Parent.ToolData
k = script.Parent.HotkeyData
buttonPressed = false
function Press(key)
if (key == k.Value) and game.ServerStorage:FindFirstChild(tool.Value) ~= nil then
if Player.Backpack:FindFirstChild(tool.Value) == nil and Player.Character:FindFirstChild(tool.Value) == nil then
local weapon = game.ServerStorage:FindFirstChild(tool.Value):clone()
weapon.Parent = Player.Backpack
repeat
Player.PlayerGui:FindFirstChild("HotKeyGuiThing"):remove()
until Player.PlayerGui:FindFirstChild("HotKeyGuiThing") == nil
workspace["Weapon Crate"]:remove()
end
end
end
Mouse.KeyDown:connect(Press)
wait (2)
repeat
Player.PlayerGui:FindFirstChild("HotKeyGuiThing"):remove()
until Player.PlayerGui:FindFirstChild("HotKeyGuiThing") == nil

1 comment
Oh, and this is just a script in the GUI. The hitbox script just puts it in the player's inventory