Hi everyone!
This is a bit of a confusing and frusturating issue, so here it out:
Whenever I transfer an item from the Backpack
to the InventoryFolder
, it does it fluently on the client. However, when I go into client view, it didn’t even change at all, and it’s just… there.
I’ve tried “cloning the tool and removing the original tool”, but that came with the same results.
Here’s some screenshots to explain it:
I’m absolutely certain that the tools aren’t cloned / parented on the client, it’s all done on the server.
Here’s my code that is involved with it:
local function keyPress(keyCode)
if keyCode.keyCode == Enum.KeyCode.H then
local toolEquipped = character:FindFirstChildOfClass("Tool")
if toolEquipped then
print('yeah')
local response = remote:InvokeServer(toolEquipped)
humanoid:UnequipTools()
end
end
end
userInputService.InputBegan:Connect(keyPress)
-- The script above is the client side for y'know, storing stuff.
--- This is the server-sided code.
local function onGiveEvent(player, itemName)
local inventory = player:WaitForChild("Inventory")
local itemFound = game.ReplicatedStorage.Tools:FindFirstChild(itemName)
if itemFound and inventory:FindFirstChild(itemName) then
itemFound.Parent = player.Backpack
print(itemFound.Parent)
return true
elseif not itemFound or not inventory:FindFirstChild("ItemName") then
antiCheatMessage(player)
end
end
local function onStoreEvent(player, item)
local inventory = player:WaitForChild("Inventory")
if item then
item.Parent = inventory
return {true, item}
else
antiCheatMessage(player)
end
end
storeEvent.OnServerInvoke = onStoreEvent
giveEvent.OnServerInvoke = onGiveEvent
Any help is appreciated!