Hello everyone, it's been a while since I've actually needed help but someone here may be able to help me more than I have to myself, so here to goes.
I used to have a script that allowed you to change the player's time using utime ofc in the middle of the game. It's all used to work on garry's mod 12, but just a few day's ago I tried to use it again and apparently DComboBox was changed to DMultiChoice. I've tried everything to get it to work again but I can't do it for my life. I'm also using Derma, because I don't understand GWEN... so yeah.
MainCheckbox = vgui.Create('DComboBox')
MainCheckbox:SetParent(MainFrame)
MainCheckbox:SetSize(221, 213)
MainCheckbox:SetPos(89, 48)
MainCheckbox:EnableHorizontal(false)
MainCheckbox:EnableVerticalScrollbar(true)
MainCheckbox:SetMultiple(false)
MainCheckbox:CenterHorizontal( )
local Players = player.GetAll()
for i = 1, table.Count(Players) do
local plyb = Players[i]
MainCheckbox:AddItem( plyb:Nick() )
end
function MainCheckbox:Think()
if (MainCheckbox:GetSelectedItems() and MainCheckbox:GetSelectedItems()[1]) then
if (MainCheckbox:GetSelectedItems()[1]:GetValue() ~= LastValue) then
local Players = player.GetAll()
for i = 1, table.Count(Players) do
local ply = Players[i]
if (MainCheckbox:GetSelectedItems() and MainCheckbox:GetSelectedItems()[1]) then
if (ply:Nick() == MainCheckbox:GetSelectedItems()[1]:GetValue()) then
w,d,h,m,s = timeToStrInd( ply:GetUTime() + CurTime() - ply:GetUTimeStart() )
CheckWeek:SetValue(w)
CheckDay:SetValue(d)
CheckHours:SetValue(h)
CheckMinutes:SetValue(m)
CheckSeconds:SetValue(s)
LastValue = ply:Nick()
end
end
end
end
end
end --function end
btnSetTime = vgui.Create('DButton')
btnSetTime:SetParent(MainFrame)
btnSetTime:SetSize(70, 25)
btnSetTime:SetPos(124, 363)
btnSetTime:SetText('Set Time')
btnSetTime.DoClick = function()
local w,d,h,m,s
local Players = player.GetAll()
for i = 1, table.Count(Players) do
local plya = Players[i]
if (MainCheckbox:GetSelectedItems() and MainCheckbox:GetSelectedItems()[1]) then
if (plya:Nick() == MainCheckbox:GetSelectedItems()[1]:GetValue()) then
local utply = plya
w = CheckWeek:GetValue()
d = CheckDay:GetValue()
h = CheckHours:GetValue()
m = CheckMinutes:GetValue()
s = CheckSeconds:GetValue()
amt = StrToTime(w,d,h,m,s)
require("datastream")
datastream.StreamToServer( "SendPly", { utply, amt } )
end
else
Errorlbl1:SetText('Please highlight a name before using this.')
ErrorFrame:MakePopup()
ErrorFrame:SetVisible( true )
end
end
end