Studio doesn't print?

Hello, so when i run my function, ii check if the target is a player, and somehow it doesn’t print. I don’t know what i did wrong. Look at the code.

Note; i have more code but that is irrelivent.

local IsAPlayer

function Target(Target)
	local TargetString = tostring(Target)
	if not Players:FindFirstChild(TargetString) then
		print(TargetString.." is not a player")
		IsAPlayer = false
	else
		print(TargetString.." is a player")
		IsAPlayer = true
	end
	print("AAAAAAAAAAAAAA") -- this prints
	print(IsAPlayer) -- this doesn't print
end
local IsAPlayer

function Target(Target)
	IsAPlayer = Target:IsA("Player")
	print("AAAAAAAAAAAAAA") -- this prints
	print(IsAPlayer) -- this doesn't print
end
1 Like
local IsAPlayer

function Target(Target)
	local TargetString = tostring(Target)
	if not Players:FindFirstChild(TargetString) then
		print(TargetString.." is not a player")
		IsAPlayer = false
	else
		print(TargetString.." is a player")
		IsAPlayer = true
	end
wait(0.1)
	print("AAAAAAAAAAAAAA") -- this prints
	print(IsAPlayer) -- this doesn't print
end

Thanks, but this is not what i searched for, it doesn’t work. Do you know something else?

This doesn’t work as well, got any other ideas?

This prints perfectly fine for me.
image

Interesting, this is my output:
image
Do you know anything? I loop the function 2 times for every target.
I have absolutely no idea why this doesn’t work.

I tried this:
image
But it doesn’t even print “EEE”:
image

Maby its a bug?

Honestly, I have absolutely no clue as to why it doesn’t print. Have you saved the script at all? ex: drafts, committing them, etc?

I don’t need to commit it, its not in team create soo…

You might just want to restart studio then, there is absolutely no reason it shouldn’t print.

1 Like

Uhhhhh, i already did that but then i did it again and somehow it now works. Thats… interesting.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.