Referencing an Object under the Player from the Server Doesn't Work


The bool object being made

The object trying to be referenced server-sided, the plr value is sourced from another remote event

  1. What do you want to achieve? I want to be able to reference the value “can_awaken”

  2. What is the issue? It is returning nothing/nil

  3. What solutions have you tried so far? I’ve tried to use :WaitForChild("can_awaken") and even use a longer timeout timer, but to no avail.

hello, it seems in the first script you are making this value in a local script.

the reason the server can’t see the value is because it only exists on the client

try making an event to make the bool value on the server, so both the client and the server can see it

and also use the same event to change that value (with sanity checks of course)

1 Like

Just to make sure, would a PlayersAdded event in a server script work? If so, I tried it and it doesn’t still recognize the BoolValue in the server, but still works in the client


heres what I did – ps: I know that the game.Debris line is wrong, but I fixed it

I wouldn’t recommend this, because every time a player joins the game, it will fire the PlayerAdded event

Usually what I do is fire an event on character spawn from the local end, that just lets the server know who the player for this script is

(if the player is stored in the character you can do something like

local Player = game.Players:GetPlayerFromCharacter(script.Parent) -- if script.Parent is the character

Sorry for late reply, heat waves in my county kept me off of my pc

Thanks for the reply, however, the server “FireMorph” script still gives nil when trying to find the BoolValue. Also to note, I have found that when I try to reference any children of the player on the server “FireMorph” script, then it just returns nil even when they were created by the server (like leaderstats). I don’t know if you can help me any further on this, but the server “FireMorph” script is fired through a main server script that controls the :FireServer() events of all the fire abilities as shown below:
Screen Shot 2022-07-29 at 3.32.17 PM

I have asked others who are far better scripters than me who said they don’t understand why it wouldn’t be able to reference the BoolValue, and this is the last thing that might be relevant to why it wouldn’t be able to that I haven’t told them about. Again, I don’t know if it is relevant, but nothing is working so I thought I might as well show it to you.

Also, the server script is stored in ServerScriptService, so I can’t do the thing you do, but that is good info to know for later on since I only know PlayerAdded as a way to get the player from the server.

Above is another roundabout way I tried to reference the can_awaken value, and see what the script sees. What it returns is the player’s leaderstats folder and backpack, it doesn’t see anything else added. Hopefully this extra information is somewhat helpful.

Strange, I can’t see why it ain’t working. Sorry I can’t help you with this one, hopefully you will come up with something soon

It’s all good, I will keep trying a few things and if they don’t work I might have to just remake the code or something.