Yo yo,
Here's my tip window script.
It's basically a window that moves up from the bottom right of your screen every 60 seconds containing a random tip specified by you.
SERVER:
msgs = {
"Message 1",
"Message 2",
"Message 3",
"Message 4"
}
function getRandomTip()
local text = msgs[math.random(1, #msgs)]
triggerClientEvent("startHint", root, text)
end
setTimer(getRandomTip, 60000, 0)
CLIENT:
sX, sY = guiGetScreenSize()
height = 1 --Starting height
maxHeight = 1.2
alpha = 0.65
noticeSound = false
noticeSoundID = 45
--VARIABLES YOU SHOULDN'T CHANGE
moveWindowForward = false
secondHeight = 0
--------------------------------
tipWnd = guiCreateWindow(sX/1.22, sY/height,227,181,"Information",false)
guiWindowSetMovable(tipWnd,false)
guiWindowSetSizable(tipWnd,false)
guiSetAlpha(tipWnd, alpha)
tipLabel = guiCreateLabel(9,26,216,144,"",false,tipWnd)
guiSetVisible(tipWnd, false)
addEvent("startHint", true)
addEventHandler("startHint", root,
function(text)
guiSetText(tipLabel, text)
moveWindowForward = true
tipWindowVisible(true)
if noticeSound then
playSoundFrontEnd(noticeSoundID)
end
end)
function tipWindowVisible(state)
guiSetVisible(tipWnd, state)
end
addEventHandler("onClientPreRender", root,
function()
if isTimer(backTimer) then return end
if moveWindowForward then
if height < maxHeight then
height = height + 0.004
end
if height >= maxHeight then
moveWindowForward = false
backTimer = setTimer(
function()
function moveItBack()
if moveWindowForward == false then
if height >= 1 then
height = height - 0.004
end
if height <= 1 then
tipWindowVisible(false)
removeEventHandler("onClientPreRender", root, moveItBack)
end
end
end
addEventHandler("onClientPreRender", root, moveItBack)
end, 9000, 1)
end
end
guiSetPosition(tipWnd, sX/1.22, sY/height, false)
end)
In the end... It should look like this: