Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if object ~= nil then
- if _task == "Remove Inventory" then -- > Player dropping item from inventory
- task.spawn(function()
- local itemGUI = StarterGui.ItemPickupGui
- local detailsGUI = StarterGui.itemDetailsGUI
- -- Spawn the item in front of the player
- object.CFrame = CFrame.new(cFrame.X + 3, cFrame.Y + 3, cFrame.Z + 3)
- object.Anchored = true
- object.CanCollide = false
- local interactGUI = itemGUI:Clone() -- > Clone of 'E-Interact' GUI for prox prompt
- interactGUI.Parent = object
- interactGUI.Enabled = true
- local prox = Instance.new("ProximityPrompt") -- > Prox prompt
- prox.Style = Enum.ProximityPromptStyle.Custom -- > Making the proxpromt invisible
- prox.ClickablePrompt = false
- prox.Parent = object
- floatTween = TweenService:Create(
- object,
- TweenInfo.new(2,Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true),
- {Position = Vector3.new(object.Position.X, object.Position.Y + .75, object.Position.Z)}
- ):Play()
- prox.Triggered:Connect(function(player)
- if tonumber(inventoryHandler.getPlayerInventorySize(player)) >= 20 then
- notifHandler.fullInventory(player)
- else
- floatTween:Cancel()
- event:Fire(player,object) -- > event to add item to players inventory IF the prox for it is triggered
- object.CFrame = CFrame.new(-3.89, 15.231, 18.28) -->Sends physcial item object to set far away place
- itemHandler.storeItem(player, object)
- prox:Destroy()
- interactGUI:Destroy()
- end
- end)
- end)
- elseif _task == "Mob Drop" then -- > Mob drops
- else
- return print("Task not specified.")
- end
- else
- if _task == "Remove Inventory" then
- return warn("Your inventory is empty.")
- elseif _task == "Mob Drop" then
- return print("Item occured spawning problem.")
- else
- return print("Item occured spawning problem.")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment