Exvinitry
(Exvinitry)
April 23, 2022, 2:56pm
#1
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
zaydoudou
(Codoudou)
April 23, 2022, 3:14pm
#2
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
Exvinitry
(Exvinitry)
April 23, 2022, 3:16pm
#3
remote events, how do i send signals to a whole new script?
1 Like
zaydoudou
(Codoudou)
April 23, 2022, 3:17pm
#4
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
Exvinitry
(Exvinitry)
April 23, 2022, 3:23pm
#5
first one is the main script, second one is localscript
like that?
1 Like
pyxfluff
(Pyx)
April 23, 2022, 3:47pm
#6
Exvinitry:
--Siring the event
script.Parent.RemoteEvent.OnClientEvent:Connect(function() print("The button was successfully pressed.") end)
1 Like
Exvinitry
(Exvinitry)
April 23, 2022, 3:50pm
#7
thanks, do i also do that with the error message? send it to the local script?
1 Like
pyxfluff
(Pyx)
April 23, 2022, 3:50pm
#8
You can also have a remote event for that, just edit the text and event it’s listening for in that previous reply.
Exvinitry
(Exvinitry)
April 23, 2022, 3:51pm
#9
That’s kinda what I asked, thanks!
1 Like
Exvinitry
(Exvinitry)
April 23, 2022, 4:09pm
#12
hm, well it isnt working, atleast im looking at the client tab and it doesnt show up
pyxfluff
(Pyx)
April 23, 2022, 4:15pm
#13
It’s MouseButton1Click
lol, unless it’s a ClickDetector
Exvinitry
(Exvinitry)
April 23, 2022, 4:16pm
#14
the main script’s parent is the detector
and the transparency part of the script does work, so its not that?
Exvinitry
(Exvinitry)
April 23, 2022, 4:19pm
#16
As well for the error message or is that automaically done?
1 Like
pyxfluff
(Pyx)
April 23, 2022, 4:27pm
#17
Yes, sorry that the like button is super inconclusive lol
Exvinitry
(Exvinitry)
April 23, 2022, 4:33pm
#19
well it still doesn’t work, what am i doing wrong
pyxfluff
(Pyx)
April 23, 2022, 4:39pm
#20
I dont see anything wrong with it