Hi. So i made a sell script in serverscriptservice and its not working. any idea why?
game.ReplicatedStorage.SellEvent.OnServerEvent:Connect(function(player) local leaderstats = player.leaderstats local RoCoin = leaderstats["Ro-Coin"] local RoBucks = leaderstats.RoBucks local Value = leaderstats.RoValue RoBucks.Value = RoBucks.Value + RoCoin.Value * Value.Value RoCoin.Value = 0 end) -- above shouldnt be interfereing, the below one is the problem game.ReplicatedStorage.SellEventDesert.OnServerEvent:Connect(function(player) local leaderstats = player.leaderstats local RoCoin = leaderstats["Ro-Coin"] local RoBucks = leaderstats.RoBucks local Value = leaderstats.RoValue local selVal = Value *2 RoBucks.Value = RoBucks.Value + RoCoin.Value * Value.Value RoCoin.Value = 0 end)
The top function looks fine but in your 2nd function you have
local Value = leaderstats.RoValue local selVal = Value *2
that's the cause of the error you're getting.
Change it to
local Value = leaderstats.RoValue.Value local selVal = Value *2
Hope this helps! :)