Avir14 Posted November 14, 2023 Share Posted November 14, 2023 Hi, I want to create a panel with a button if you click on the button an image appear on all players screen in the server and disappear after 2 sec How to do it, can anyone give me an example please. Thanks Link to comment
Spakye Posted November 15, 2023 Share Posted November 15, 2023 Hello, I will try to give you some step by step indications on how you can do it rather than give you ready to use code. Client side, try to create a windows with guiCreateWindow() Try to make it appear and disappear with guiSetVisible(), you did not specify how and when you want the window to appear so i can only recommend trying with a commandHandler for now. You can easily replace it later on. Try to add a button to the window with guiCreateButton() and to attach it to a function with addEventHandler("onClientGUIClick", yourButton, youFunction) Try to make an easy function that output some text at first with outputChatBox() At that point you should be able to show the window, close the window, and print a message by clicking the button. Server Side, make a simple function that print some text like "server received the trigger", create an event with addEvent(), and add an event handler that calls the function you just made when the event is triggered. Back to client side try to add a server event trigger with triggerServerEvent() that will trigger the event you just created. If it works and you see your message sent from server side you have done the hardest part. Now you will do the same thing but in the other way. Create an event client side, trigger it from the server with triggerClientEvent(), make a function that shows your picture with guiCreateStaticImage(), hide the picture with setTimer() Thats pretty much it, its not very well explained and detailed but i can help you out if you struggle with something specific later on. Please just give it a try Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now