local issamemodel = players:GetPlayerFromCharacter(v:FindFirstAncestorWhichIsA("Model")) == players:GetPlayerFromCharacter(script.Parent.Parent.Parent)
local IsHumanoid = v:FindFirstAncestorWhichIsA("Model"):FindFirstChildWhichIsA("Humanoid")
print( (issamemodel) and IsHumanoid)
My problem is that this always prints humanoid instead of true or false, how can i change that?
The humanoid is an instance, not a boolean value. It’ll print the name of the instance, therefore it outputs as “Humanoid”. If you need to have it as a boolean, use:
if IsHumanoid then
IsHumanoid = true
else IsHumanoid = false
end
It would always return Humanoid, but if used as a boolean variable, such as a if statement, it will be interpreted as true, as if an instance exists, it’s true, and vice versa.
That would be the case, but since you’re actually finding an object that’s an Instance & not of an actual property or conditional check, the Instance is being returned back (Or nil)
You could just reference it as a Bool value instead like @Doqee mentioned earlier
local HumanoidCheck
local issamemodel = players:GetPlayerFromCharacter(v:FindFirstAncestorWhichIsA("Model")) == players:GetPlayerFromCharacter(script.Parent.Parent.Parent)
local IsHumanoid = v:FindFirstAncestorWhichIsA("Model"):FindFirstChildWhichIsA("Humanoid")
print(issamemodel)
if IsHumanoid then
HumanoidCheck = true
else
HumanoidCheck = false
end
print(HumanoidCheck)