Im trying to make it so you can drop items in your inventory for my survival game
it seems to just be a typing error but I don’t really know where I got wrong
it says "Expected identifier when parsing expression, got ‘=’ "
DropItem:FireServer() = function(player, itemName)
local Inventory = player.Inventory
local item = Inventory:FindFirstChild(itemName)
if item then
if item.Value>0 then
item.Value = item.Value - 1
local itemClone= Items:FindFirstChild(itemName):Clone()
itemClone.CFrame = player.Character.HumanoidRootPart.CFrame + player.Character.HumanoidRootPart.CFrame.LookVector * 6 -- clone the part infront of player
itemClone.Parent = game.Workspace
return true
else
return false
end
end
end
You can fix the error by putting a space between “itemClone” and the “=”.
Also, why do you need a custom drop system? Roblox already gives you a setting to make players be able to drop items.
Also if you solved it, consider marking this post solved with my message, so people that come to this post will know that it’s solved and you no longer require help.