Hero192 Posted September 22, 2015 Share Posted September 22, 2015 Hey guys im making a login system but i stuck on something, i want when i start the resource only people who have no account or they're guest account they who can see the gui ,since the onResourceStart event do not accept 'source' i tried this way but nothing works.. i did trigger from client to server it's for the GUI Visiblity Here's the code, no error it just doesn't works addEventHandler( "onResourceStart", root, function () checkGuestAccount() end) function checkGuestAccount () local account = getPlayerAccount(source) if not account or isGuestAccount(account) then showPlayerHudComponent ( source, "clock", true ) showPlayerHudComponent ( source, "radar", true ) showPlayerHudComponent ( source, "area_name", true ) showChat ( source, true ) showCursor( source, true ) fadeCamera( source, true, 1 ) setCameraMatrix(source, -1212.281, 185.058, 84.00, -1780, 790, 70) outputChatBox("* Welcome .",source,255,255,0) triggerClientEvent(source,"onJoin",source) else return false end end Link to comment
Moderators IIYAMA Posted September 22, 2015 Moderators Share Posted September 22, 2015 Source is the resourceRoot and not a payer. OnResourceStart event doesn't ever have a player as source. 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