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

I’m currently having issues trying to get the script to work, it shows the Sell from replicated isn’t there, but it is

I’m using a server script
Screenshot 2022-01-17 120329

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)
1 Like

Can you provide a quick screenshot of how your ReplicatedStorage is structured? Like, what it contains and how folders are organized?

image

You said Workspace , but in the script you try to find it in ReplicatedStorage?

I see nothing in the folder BindableEvents

so i put sell in for bindable events now i’m getting this error
image

Again , I don’t think you have an element named Event in your Sell

this is the script where the error is i dont know what to do

ReplicatedStorage.BindableEvents.Sell.Event:Connect(function(player)

Can you give me another screenshot with your ReplicatedStorage?

[
image

Let me explain to you:

You are trying to acess an element called Event in the RemoteEvent Sell , but you don’t have any elements in your RemoteEvent!

so what do i do add another event?

You find ReplicatedStorage in your game , then you find in it an folder named BindableEvents then in that folder you try to find an element called Sell in that element you try to find an element called Event.

i have sell in the Bindable events and i’m getting a error

I don’t know what you are trying to do , but you need something in Sell called event

i put in a event inside the sell and now i’m getting a error saying Fire is not a valid member of RemoteEvent “ReplicatedStorage.BindableEvents.Sell”

Hmm, this is pretty strange.
Try, in the first line (where you declare the “ReplicatedStorage” variable), to replace local ReplicatedStorage = game.ReplicatedStorage with local ReplicatedStorage = game:GetService("ReplicatedStorage"). Maybe the script is running before the game loads.

i fixed the error but i cant get my sell to work i keep getting another error after another Cash is not a valid member of Folder “Players.Guest_player1689.leaderstats”

player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + player.leaderstats.Power.Value*2

RemoteEvents don’t have a universal :Fire method, you either have to use :FireClient() if you’re on the server (and you also have to put the player instance in the argument, or :FireServer() if you’re on the client. (There’s also :FireAllClients() as well, if you want to fire the event to every client)

Also, it seems you want to access a lot of things right when they load in. Try using :WaitForChild() to wait for them to exist, like:

local stats = LocalPlayer:WaitForChild("leaderstats")
local Cash = stats:WaitForChild("Cash")

do i put this in the beginning of my code?