Why wont bool value pass through event?

Its hard to explain what im doing, but in short im trying to send a bool value through and event.

when i try to send the value (typed from a text box) it wont work.
the reciving script would check if a bool is true or false and then do something according to that
although for some reason its not workin all the the sudden.

(please tell me what script you want to see, because there are 2)

you arent showing your code so its very hard to help

what one though? send or recive

both ofc. youre sending an event its not a question of one or the other. it might be an issue with one script or the other or both

For some reason, instances don’t pass through events, even if they are in a place accessible by both the client and the server. You should instead pass something it can be identified by, such as it’s name, or just it’s value.

also you. might be sending a string through (if its typed from a textbox) and not even a bool. without seeing any scripts that is probably what the issue is

We can’t figure out what’s wrong without being able to see what’s wrong.

how would i turn the string into a bool??? (im getting the scripts hold on)

i dont think they are passing an instance im pretty sure they are passing a string typed from a textbox

oh “bool value” kind of confused me

yeah @Vortexuel560 we are gonna need to see the scripts to help further.

i mean right off the top of my head you could use an if statement (if “true” then return true else return false end) but there is probably a more efficient way


	if ItemName.Text == "Announce" then
		Handler:FireServer("Announce", param1.Text, param2.Text)

(this is jsut a snippet, AKA the important one. “param 2.text” is the bool)


local Handler = game.ReplicatedStorage.AdminPanelRequest
local notif = game.ReplicatedStorage.CMDErrorSender

local players = game:GetService("Players")

Handler.OnServerEvent:Connect(function(plr, Kind, param1, param2)
	if Kind == "Announce" then
		for _, player in pairs(players:GetPlayers()) do
			notif:FireClient(player, param1, param2)

(this just goes on to fire to the actual thing that recives the bool. other scripts that send the bool to this event work fine, so idk why this one wont work.)

that is 100% a string you are sending and not a bool value

how do i convert the string to a bool then

i said a (nonefficient) way before ^^

wait i think i might have a better idea

local function StringToBool(String: string): boolean
    if String == "true" then
       return true

    return false

cool - on another note, there is probably a better way to handle your sevent firing. i think you can fire all clients from the client, although i could be wrong. i do not believe there is a reason to send anything to the server. got to go, good luck

There’s a way to convert it to a Boolean in one line.

local finalVar = stringBoolHere == "true"

if stringBoolHere contains “true” then finalVar will be set to true
otherwise it will be set to false

that looks so cursed lol, its like turning an instance into a bool value
(not not Instance)