Hello.
I need somethink I hope simple.
When player pickup an item.
I need he can't pickup a new one befor he drop it.
I have core pickup ability with any core item it can be grab.
And drop script from community content.
I just need to lock pickup ability after pickup.
And unlock pickup ability after drop item.
Pickup ability does not requière scripting.
I don't know how it's work.
If you take a core item, like a weapon, you can del script and pickup stay available.
So I can't manage pikcup restriction on the equipment script.
I can only try to lock keybind ability after pickup.
Have a nice day.
Hello.
This one is tricky, especially not knowing what your code looks like or what you have going on there. One possible solution would be something like this:
local trigger = script.parent
function ChangeTrigger(Trigger, player)
if player and player:IsA("Player") then
if #player:GetEquipment() ~= 0 then
Trigger.isInteractable = false
else
Trigger.isInteractable = true
end
end
end
trigger.beginOverlapEvent:Connect(ChangeTrigger)
trigger.endOverlapEvent:Connect(ChangeTrigger)
Basically you would add this script as a child to each weapon trigger in your game and then when the player overlaps the trigger it would check if they already own a weapon and hide/disable the trigger, else the trigger will be shown/enabled. It may need a little customization from your side to work with your own scripts. There may be a more elegant solution to the problem but this should be helpful.
Please let me know if you need any more help
Thanks. I think it's good way. I will work on. Just need to replacer scipt.parent by the resul of the trace or somethink like that. thanks.