Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

is it possible to print boolean?

player = {"WindowMall"}
local players = game:GetService("Players")
local replicatedstorage = game:GetService("ReplicatedStorage")
local hatsfolder = replicatedstorage:WaitForChild("Hats")
local Dominus = hatsfolder:WaitForChild("Dominus")

for i,plr in pairs(players:GetPlayers()) do
	local check = false
	if players.Name == player[1] then
		return true
	else
		return false
	end
	print(check)
end****

also i had a gui when i click the text it will fire

1 answer

✓ Accepted answer

You can, actually.

You can print a boolean using a built-in function called tostring(value). In a nutshell, tostring() turns any value into a string. For example:

local var = true
print(tostring(var)) --true

In your case, on line 14, you should change print(check) to print(tostring(check))

Edited Code:

player = {"WindowMall"}
local players = game:GetService("Players")
local replicatedstorage = game:GetService("ReplicatedStorage")
local hatsfolder = replicatedstorage:WaitForChild("Hats")
local Dominus = hatsfolder:WaitForChild("Dominus")

for i,plr in pairs(players:GetPlayers()) do
    local check = false
    if players.Name == player[1] then
        return true
    else
        return false
    end
    print(tostring(check)) --edited
end****

This discussion is preserved as it was. New answers, comments, and votes are closed.