Well i have this script where it works like an inventory gui Rn i have made it so you lose your item when clicking on it but i want it to be copied right infront of you (player) in workspace
01 | local button = script.Parent |
02 | button.Position = UDim 2. new( 0.032 , 0 , 0.5 , 0 ) |
03 |
04 | local open = false |
05 |
06 |
07 | button.MouseButton 1 Click:Connect( function () |
08 |
09 | open = not open |
10 |
11 | local newPos = open and UDim 2. new( 0.319 , 0 , 0.5 , 0 ) or UDim 2. new( 0.032 , 0 , 0.5 , 0 ) |
12 |
13 | button:TweenPosition(newPos, "InOut" , "Quint" , 0.5 ) |
14 | end ) |
15 |
since the item i will drop isnt specific it have something to do with the script here
I would recommend looking into LookVectors
It would probably be something similar to the following, but I'm not too good at math.
1 | local HRP = Player.Character.HumanoidRootPart |
2 | local GearClone = Gear:Clone() |
3 | GearClone.Parent = game.Workspace |
4 | --Make sure that the parts of the item can collide when on the ground but not when in an inventory. |
5 |
6 | GearClone.Handle.CFrame = HRP.CFrame + (HRP.CFrame.LookVector * n) |
Sorry for the somewhat poor explanation and answer but I wanted you to see this, definitely respond with the code you create and mark that as the answer as this answer probably isnt too helpful.