I'm currently working on a currency exchange system that is ran by 2 scripts and you just put the amount you want to exchange and you click a button and when that happens it fires an even sending the player and the amount the player wants to receive and in the script that does that I have a Variable that holds a value calculated from doing this equation Receiving.Value * 1000
, but it doesn't do that and I get the error Value is not a valid member of Player "Players.vincentthecat1
.
--###----------[[FIRESEVENT]]----------###--
ExchangeButton.MouseButton1Down:Connect(function() ExchangeEvent:FireServer(Player, Receiving) end)
--###----------[[COLLECTSDATA]]----------###--
ExchangeEvent.OnServerEvent:Connect(function(Player, Receiving) local Cost = Receiving.Value * 1000 --The Line the error comes from. if Player.leaderstats.Bux.Value >= Cost then Player.leaderstats.Bux.Value -=Cost Player.leaderstats.Gems.Value +=Receiving end end)
When you fire server, the player argument is automatically sent in already so you dont have to do it. Just remove Player argument when doing :FireServer()
ExchangeEvent:FireServer(Receiving)