Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why wont my currency Exchange System work?

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)

1 answer

✓ Accepted answer

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)

3 comments

0

I forgot about that this has to be the dumbest moment in my entire life lol anyways thanks for the help!

0

I fixed the error but nothing happens now

0

Okay I fixed it.

This discussion is preserved as it was. New answers, comments, and votes are closed.