Did you happen to use the wrong code for your local script? Because on the client, you’re firing a remote with TeleportEvent but on the server, you’re receiving the remote with InventoryEvent ?
Oh crap I forgot to include the 3rd script (what sends to inventory event) and the 4th (which receives teleport event)
3rd (LS)
local tool = script.Parent
local anim = tool:WaitForChild("Hit")
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local load = hum:LoadAnimation(anim)
local mouse = plr:GetMouse()
print("vars")
tool.Activated:Connect(function()
load:Play()
if mouse.Target.Name == "Anvil" then
game.ReplicatedStorage:WaitForChild("InventoryEvent"):FireServer()
print("anvil")
end
end)
if plr.Inventory.Value is lower than plr.Inventory.InventoryMax.Value, and plr.Inventory.Value += 1 * plr.Multiplier.Value keeps the condition true, it will always execute the code within that condition instead of executing the else block.
Maybe have the if statement separated from the Visible property modifier? That way, it always shows the UI?
game.ReplicatedStorage.InventoryEvent.OnServerEvent:Connect(function(plr)
if plr.Inventory.Value < plr.Inventory.InventoryMax.Value then
plr.Inventory.Value += 1 * plr.Multiplier.Value
print("added")
end
plr.PlayerGui.SellWarning.Container.Visible = true
end)