he made Bools as a folder inside player
I’ve mentioned that, he says it’s not his actual code.
Not true, “bool” is an upvalue (local variable) of changevalue, it cannot be referenced outside of the given function.
Also
local bool = Insta…
Is a upvalue declared after the function, it cannot be referenced by changevalue(), it’s not a global.
no and it’s done in a separate script. A local script. The object value is made on a server script and “bools” doesnt get fired to the server so i don’t know how it would call the first variable
from exeplex’s code
why are you setting it to nil
function changevalue(player)
local pbools = player.Bools
local value = pbools.BombPlanted
value.Value = player
end
local bools = Instance.new("Folder", Player)
bools.Name = "Bools"
local bombplanted = Instance.new("ObjectValue", bools)
bombplanted.Name = "BombPlanted"
Remote.OnServerEvent:Connect(function(player) -- Changed to lower case
changeValue(player)
end)
Alright, when a bomb is planted it calls the Player of the Character you’ve planted it on. then the object value changes to the Player you set it on. That’s why i didnt set it straight up.
No, what I am saying is that if you want “value =” to the folder with the certain value, why did you call “Bools.BombPlanted” instead of “bools.BombPlanted”. You may have capitalized the folder variable on accident?
where is that in the code i cant find it nevermind ok that was a typo from typing the sample code here in devforum instead of studio
In the “changevalue” function.
is this inside a player added event or not?
This is not when a player is added, it is when the player clicks a key.
making the instance should be inside a player added event or add the instance when an event is going on
This user is not having a “player added event”.
if he cant have player as a variable then it wont work
He’s not, it is being sent through the fired event as the client.
well its outside of the event how can you set it outside of the event
" As noted in step #2, the server must pass a
Player
object withFireClient()
. However, the receiving client-side function does not need to account for the player object in its list of parameters, so that function can begin with the second piece of data passed, in this casemaxPlayers
."
remember the events parameter wont work on anything outside of that event
he didnt fire anything on the server though
The Remote variable is just the BombPlant variable in the localscript. Just that i gave it a different name
if this is inside the local script then
why should it not work
Remote.OnServerEvent:Connect(function(player) -- Changed to lower case
changeValue(player)
end)