Dev Console issues with print()

So I’ve recently come back to scripting and I use print() for if then statement, also using the else
thingy. See for yourself, I want that the prints can be seen by everyone in the f9 menu thingy. Is that possible? And by that, I’ll take any advice for changes, improvements etc!

local part = script.Parent.Parent
local dec = true
local workmsg = "The button was successfully pressed."
local errormsg = "The cool down of 3 seconds is still going on."

script.Parent.MouseClick:Connect(function()
	if dec == true then
		print(workmsg)
		if part.Transparency == 0 then
			part.Transparency = 1
		else
			part.Transparency = 0
		end
		dec = false
		wait(3)
		dec = true
	else
		print(errormsg)
	end
end)
1 Like

Easy, just print it in a local script.

You can also use remote events to send signals to the local script whenever a player interacts with the part itself.

1 Like

remote events, how do i send signals to a whole new script?

1 Like

Like i said, use remoteEvent:FireClient(plr) to fire it to a local script which you will then make a .OnClient signal in that local script

1 Like

image

image

first one is the main script, second one is localscript
like that?

1 Like

--Siring the event

script.Parent.RemoteEvent.OnClientEvent:Connect(function() print("The button was successfully pressed.") end)
1 Like

thanks, do i also do that with the error message? send it to the local script?

1 Like

You can also have a remote event for that, just edit the text and event it’s listening for in that previous reply.

That’s kinda what I asked, thanks!

1 Like

is this right?

1 Like

Yep

hm, well it isnt working, atleast im looking at the client tab and it doesnt show up

image

It’s MouseButton1Click lol, unless it’s a ClickDetector

the main script’s parent is the detector
and the transparency part of the script does work, so its not that?

Use FireAllClients

As well for the error message or is that automaically done?

1 Like

Yes, sorry that the like button is super inconclusive lol

image


this good?

1 Like

well it still doesn’t work, what am i doing wrong

I dont see anything wrong with it