Sell is not a valid member of Folder "ReplicatedStorage.BindableEvents"

Don’t replace .OnServerEvent on that line with .Event; only change the line that’s relating to the Sell event.

Result:

local ReplicatedStorage = game.ReplicatedStorage

ReplicatedStorage.RemoteEvents.Power.OnServerEvent:Connect(function(player, valueFolder)
	if player.Debounce.Value == false then
		player.leaderstats.Power.Value = player.leaderstats.Power.Value + valueFolder.Power.Value*(player.leaderstats.Rebirths.Value + 1)
		player.Debounce.Value = true
		wait(valueFolder.cooldown.Value)
		player.Debounce.Value = false
	end
end)
ReplicatedStorage.BindableEvents.Sell.Event:Connect(function(player)
	if player ~= nil then 
		player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + player.leaderstats.Power.Value*2
		player.leaderstats.Power.Value = 0 
	end
end)

ok that worked but i still have Cash is not a valid member of Folder “Players.Guest_player1689.leaderstats”

and cash is in there
image

I agree with this, you’re trying to call for something that doesn’t exist.

06d372b218cfe46b8d4f856690385c2a90c14abd

Scripts are case sensitive. Rename “cash” in the leaderstats to “Cash”.

If you’re trying to get it to operate from an event activation, you have to first make sure that you have a LocalScript fire it to the server, then you’ll use “OnServerEvent” like on the first function. Do you mind elaborating on what you’re exactly looking to happen?

wow i cant believe i made a typo thanks for your help everything is working now

1 Like

Based off of this, I think you may be trying to fire the event, for that you have to use . . . :FireServer() if you are using a local script.