this is where is remote event
local repsto = game:GetService("ReplicatedStorage")
local sellEvent = repsto:WaitForChild("Eventos").SellEvent
and this is my sell script
local sellitem = script.Parent.Parent.SellItem
local itemprice = script.Parent.Parent.ItemPrice
local sellbut = script.Parent
local player = game.Players.LocalPlayer
local inventory = player:WaitForChild("Inventory")
local leaders = player:WaitForChild("leaderstats")
local money = leaders:WaitForChild("Money")
local backpack = inventory:FindFirstChild("BackPack")
sellbut.MouseButton1Click:Connect(function()
if sellitem.Text == "Coal" and inventory.Coal.Value >= 1 then
local nice = inventory.Coal.Value * 10
money.Value = money.Value + nice
backpack.Value = backpack.Value - inventory.Coal.Value
inventory.Coal.Value = inventory.Coal.Value - inventory.Coal.Value
elseif sellitem.Text == "Gold Ore" and inventory.GoldOre.Value >= 1 then
local nice = inventory.GoldOre.Value * 100
money.Value = money.Value + nice
backpack.Value = backpack.Value - inventory.GoldOre.Value
inventory.GoldOre.Value = inventory.GoldOre.Value - inventory.GoldOre.Value
elseif sellitem.Text == "Iron Ore" and inventory.IronOre.Value >= 1 then
local nice = inventory.IronOre.Value * 50
money.Value = money.Value + nice
backpack.Value = backpack.Value - inventory.IronOre.Value
inventory.IronOre.Value = inventory.IronOre.Value - inventory.IronOre.Value
else
print("fail")
end
end)
i dont know how to use remote events :D

1 comment
This would be sort of difficult to explain in an answer I recommend that you follow a video or 2 and mess around with them a little bit.