Hi
I'm trying to create a DFrame that opens when a player first joins the server. This isn't my problem, though
My problem is I want a button on that DFrame that sets the player's team (
Player:SetTeam ). When I checked, Player:SetTeam is serverside lua, but the place where I set the function of the DButton is in a clientside file...so what would I do?
Here's the code of the file so far
function PickMyTeamWindow()
TeamPickW = vgui.Create( "DFrame" )
TeamPickW:SetSize( 270, 200 )
TeamPickW:SetPos( ScrW(), ScrH() )
TeamPickW:SetTitle( "Please select the team you wish to be on." )
TeamPickW:SetBackgroundBlur( true )
TeamPickWPri = vgui.Create( "DButton", TeamPickW )
TeamPickWPri:SetText( "Prisoners" )
TeamPickWPri:SetPos( )
TeamPickWPri:SetSize( 100, 30 )
TeamPickWPri.DoClick = function()
ply:SetGamemodeTeam( 0 )
end
end