Hi,
Is there a Convar (console command) to set the players run speed? I can't seem to find one and, since I'm using this in a Lua project, I figured I'd ask here. (I'm using a NumSlider in a derma menu and I need it to set the run speed to the NumSliders current value.)
Cheers!
no, but you can change it as part of the gamemode
garrysmod/gamemodes/sandbox/gamemode/init.lua
ctrl + f "SetPlayerSpeed"
No, but there's a function, player.SetRunSpeed().
-wait what-
Ok, for my slider:
[lua]player.SetRunSpeed(DNumSlider4.Value)[/lua]
is this correct or is my other programming habits eating my brain
[editline]7th November 2010[/editline]
Oh rubbish:
[code][lua\singleplayer.lua:32] attempt to index global 'vgui' (a nil value)[/code]
Now my VGUI doesn't work..
[lua]
local DNumSlider4
local DNumSlider3
local DNumSlider2
local DCheckBox9
local DCheckBox8
local DCheckBox7
local DLabel2
local DCheckBox6
local DPanel6
local DButton17
local DButton16
local DButton15
local DButton14
local DLabel1
local DButton12
local DButton11
local DButton6
local DButton10
local DButton5
local DButton4
local DButton9
local DButton3
local DButton2
local DButton7
local DButton1
local DPanel3
local DFrame1
DNumSlider4 = vgui.Create('DNumSlider')
DNumSlider4:SetSize(145, 40)
DNumSlider4:SetPos(355, 180)
DNumSlider4:SetDecimals(0)
DNumSlider4:SetFloatValue(0)
DNumSlider4:SetFraction(0)
DNumSlider4.OnMouseReleased = function() end
DNumSlider4.OnValueChanged = player.SetRunSpeed(DNumSlider4.Value)
DNumSlider4:SetText('Run speed')
DNumSlider4:SetValue(0)
DNumSlider4:SetMinMax( 0, 100)
DNumSlider3 = vgui.Create('DNumSlider')
DNumSlider3:SetSize(145, 40)
DNumSlider3:SetPos(355, 260)
DNumSlider3:SetDecimals(0)
DNumSlider3:SetFloatValue(0)
DNumSlider3:SetFraction(0)
DNumSlider3.OnMouseReleased = function() end
DNumSlider3.OnValueChanged = function() end
DNumSlider3:SetText('Noclip Speed')
DNumSlider3:SetValue(0)
DNumSlider3:SetMinMax( 0, 1)
DNumSlider2 = vgui.Create('DNumSlider')
DNumSlider2:SetSize(145, 40)
DNumSlider2:SetPos(355, 220)
DNumSlider2:SetDecimals(0)
DNumSlider2:SetFloatValue(0)
DNumSlider2:SetFraction(0)
DNumSlider2.OnMouseReleased = function() end
DNumSlider2.OnValueChanged = function() end
DNumSlider2:SetText('Maximum Props')
DNumSlider2:SetValue(0)
DNumSlider2:SetMinMax( 0, 256)
DCheckBox9 = vgui.Create('DCheckBoxLabel')
DCheckBox9:SetPos(355, 120)
DCheckBox9:SetText('Fall Damage')
DCheckBox9:SetConVar(mp_falldamage)
DCheckBox9.DoClick = function() end
DCheckBox9:SizeToContents()
DCheckBox8 = vgui.Create('DCheckBoxLabel')
DCheckBox8:SetPos(355, 80)
DCheckBox8:SetText('Player Damage')
DCheckBox8:SetConVar(sbox_plpldamage)
DCheckBox8.DoClick = function() end
DCheckBox8:SizeToContents()
DCheckBox7 = vgui.Create('DCheckBoxLabel')
DCheckBox7:SetPos(355, 100)
DCheckBox7:SetText('Noclip enabled')
DCheckBox7:SetConVar(sbox_noclip)
DCheckBox7.DoClick = function() end
DCheckBox7:SizeToContents()
DLabel2 = vgui.Create('DLabel')
DLabel2:SetPos(360, 40)
DLabel2:SetText('Misc. Settings')
DLabel2:SizeToContents()
DLabel2:SetTextColor(Color(0, 0, 0, 255))
DCheckBox6 = vgui.Create('DCheckBoxLabel')
DCheckBox6:SetPos(355, 60)
DCheckBox6:SetText('God mode')
DCheckBox6:SetConVar(sbox_godmode)
DCheckBox6.DoClick = function() end
DCheckBox6:SizeToContents()
DPanel6 = vgui.Create('DPanel')
DPanel6:SetSize(185, 325)
DPanel6:SetPos(350, 35)
DButton17 = vgui.Create('DButton')
DButton17:SetSize(85, 30)
DButton17:SetPos(255, 265)
DButton17:SetText('Gravity Gun')
DButton17.DoClick = "give weapon_physcannon"
DButton16 = vgui.Create('DButton')
DButton16:SetSize(85, 30)
DButton16:SetPos(165, 265)
DButton16:SetText('Camera')
DButton16.DoClick = "give gmod_camera"
DButton15 = vgui.Create('DButton')
DButton15:SetSize(85, 30)
DButton15:SetPos(255, 230)
DButton15:SetText('Tool Gun')
DButton15.DoClick = "give gmod_tool"
DButton14 = vgui.Create('DButton')
DButton14:SetSize(85, 30)
DButton14:SetPos(165, 230)
DButton14:SetText('Physics Gun')
DButton14.DoClick = "give weapon_physgun"
DLabel1 = vgui.Create('DLabel')
DLabel1:SetPos(225, 40)
DLabel1:SetText('Weapons')
DLabel1:SizeToContents()
DLabel1:SetTextColor(Color(0, 0, 0, 255))
DButton12 = vgui.Create('DButton')
DButton12:SetSize(175, 40)
DButton12:SetPos(165, 300)
DButton12:SetText('Strip weapons')
DButton12.DoClick = ply:stripWeapons();
DButton11 = vgui.Create('DButton')
DButton11:SetSize(85, 30)
DButton11:SetPos(255, 195)
DButton11:SetText('TMP')
DButton11.DoClick = "give weapon_tmp"
DButton6 = vgui.Create('DButton')
DButton6:SetSize(85, 30)
DButton6:SetPos(165, 195)
DButton6:SetText('Pump shotgun')
DButton6.DoClick = "give weapon_pumpshotgun"
DButton10 = vgui.Create('DButton')
DButton10:SetSize(85, 30)
DButton10:SetPos(255, 125)
DButton10:SetText('Mac10')
DButton10.DoClick = "give weapon_mac10"
DButton5 = vgui.Create('DButton')
DButton5:SetSize(85, 30)
DButton5:SetPos(165, 125)
DButton5:SetText('M4')
DButton5.DoClick = "give weapon_m4"
DButton4 = vgui.Create('DButton')
DButton4:SetSize(85, 30)
DButton4:SetPos(165, 160)
DButton4:SetText('MP5')
DButton4.DoClick = "give weapon_mp5"
DButton9 = vgui.Create('DButton')
DButton9:SetSize(85, 30)
DButton9:SetPos(255, 90)
DButton9:SetText('Glock')
DButton9.DoClick = "give weapon_glock"
DButton3 = vgui.Create('DButton')
DButton3:SetSize(85, 30)
DButton3:SetPos(255, 160)
DButton3:SetText('Para')
DButton3.DoClick = "give weapon_para"
DButton2 = vgui.Create('DButton')
DButton2:SetSize(85, 30)
DButton2:SetPos(255, 55)
DButton2:SetText('Desert Eagle')
DButton2.DoClick = "give weapon_deagle"
DButton7 = vgui.Create('DButton')
DButton7:SetSize(85, 30)
DButton7:SetPos(165, 90)
DButton7:SetText('Fiveseven')
DButton7.DoClick = "give weapon_fiveseven"
DButton1 = vgui.Create('DButton')
DButton1:SetSize(85, 30)
DButton1:SetPos(165, 55)
DButton1:SetText('AK-47')
DButton1.DoClick = "give weapon_ak47"
DPanel3 = vgui.Create('DPanel')
DPanel3:SetSize(185, 325)
DPanel3:SetPos(160, 35)
DFrame1 = vgui.Create('DFrame')
DFrame1:SetSize(390, 355)
DFrame1:SetPos(155, 10)
DFrame1:SetTitle('Singleplayer necessities')
DFrame1:SetDeleteOnClose(false)
DFrame1:MakePopup()
DCheckBox5 = vgui.Create('DCheckBoxLabel')
DCheckBox5:SetParent(DFrame1)
DCheckBox5:SetPos(310, 215)
DCheckBox5:SetText('All Talk')
DCheckBox5.DoClick = function() end
DCheckBox5:SizeToContents()
[/lua]
Anyone know what's wrong here?
[lua]local DNumSlider4
local DNumSlider3
local DNumSlider2
local DCheckBox9
local DCheckBox8
local DCheckBox7
local DLabel2
local DCheckBox6
local DPanel6
local DButton17
local DButton16
local DButton15
local DButton14
local DLabel1
local DButton12
local DButton11
local DButton6
local DButton10
local DButton5
local DButton4
local DButton9
local DButton3
local DButton2
local DButton7
local DButton1
local DPanel3
local DFrame1
DFrame1 = vgui.Create('DFrame')
DFrame1:SetSize(690, 385)
DFrame1:SetPos(155, 10)
DFrame1:SetTitle('Singleplayer necessities')
DFrame1:SetDeleteOnClose(false)
DFrame1:MakePopup()
DPanel3 = vgui.Create('DPanel',DFrame1)
DPanel3:SetSize(185, 325)
DPanel3:SetPos(160, 35)
DCheckBox5 = vgui.Create('DCheckBoxLabel',DFrame1)
DCheckBox5:SetPos(310, 215)
DCheckBox5:SetText('All Talk')
DCheckBox5.DoClick = function() end
DCheckBox5:SizeToContents()
DNumSlider4 = vgui.Create('DNumSlider',DFrame1)
DNumSlider4:SetSize(145, 40)
DNumSlider4:SetPos(355, 180)
DNumSlider4:SetDecimals(0)
//DNumSlider4:SetFloatValue(0)
//DNumSlider4:SetFraction(0)
DNumSlider4.OnMouseReleased = function() end
DNumSlider4.OnValueChanged = function() end //player.SetRunSpeed(DNumSlider4.Value)
DNumSlider4:SetText('Run speed')
DNumSlider4:SetValue(0)
DNumSlider4:SetMinMax( 0, 100)
DNumSlider3 = vgui.Create('DNumSlider',DFrame1)
DNumSlider3:SetSize(145, 40)
DNumSlider3:SetPos(355, 260)
DNumSlider3:SetDecimals(0)
//DNumSlider3:SetFloatValue(0)
//DNumSlider3:SetFraction(0)
DNumSlider3.OnMouseReleased = function() end
DNumSlider3.OnValueChanged = function() end
DNumSlider3:SetText('Noclip Speed')
DNumSlider3:SetValue(0)
DNumSlider3:SetMinMax( 0, 1)
DNumSlider2 = vgui.Create('DNumSlider',DFrame1)
DNumSlider2:SetSize(145, 40)
DNumSlider2:SetPos(355, 220)
DNumSlider2:SetDecimals(0)
//DNumSlider2:SetFloatValue(0)
//DNumSlider2:SetFraction(0)
DNumSlider2.OnMouseReleased = function() end
DNumSlider2.OnValueChanged = function() end
DNumSlider2:SetText('Maximum Props')
DNumSlider2:SetValue(0)
DNumSlider2:SetMinMax( 0, 256)
DCheckBox9 = vgui.Create('DCheckBoxLabel',DFrame1)
DCheckBox9:SetPos(355, 120)
DCheckBox9:SetText('Fall Damage')
DCheckBox9:SetConVar("mp_falldamage")
DCheckBox9.DoClick = function() end
DCheckBox9:SizeToContents()
DCheckBox8 = vgui.Create('DCheckBoxLabel',DFrame1)
DCheckBox8:SetPos(355, 80)
DCheckBox8:SetText('Player Damage')
DCheckBox8:SetConVar("sbox_plpldamage")
DCheckBox8.DoClick = function() end
DCheckBox8:SizeToContents()
DCheckBox7 = vgui.Create('DCheckBoxLabel',DFrame1)
DCheckBox7:SetPos(355, 100)
DCheckBox7:SetText('Noclip enabled')
DCheckBox7:SetConVar("sbox_noclip")
DCheckBox7.DoClick = function() end
DCheckBox7:SizeToContents()
DLabel2 = vgui.Create('DLabel',DFrame1)
DLabel2:SetPos(360, 40)
DLabel2:SetText('Misc. Settings')
DLabel2:SizeToContents()
DLabel2:SetTextColor(Color(0, 0, 0, 255))
DCheckBox6 = vgui.Create('DCheckBoxLabel',DFrame1)
DCheckBox6:SetPos(355, 60)
DCheckBox6:SetText('God mode')
DCheckBox6:SetConVar("sbox_godmode")
DCheckBox6.DoClick = function() end
DCheckBox6:SizeToContents()
DPanel6 = vgui.Create('DPanel',DFrame1)
DPanel6:SetSize(185, 325)
DPanel6:SetPos(350, 35)
DButton17 = vgui.Create('DButton',DFrame1)
DButton17:SetSize(85, 30)
DButton17:SetPos(255, 265)
DButton17:SetText('Gravity Gun')
DButton17.DoClick = function() LocalPlayer():ConCommand("give weapon_physcannon") end
DButton16 = vgui.Create('DButton',DFrame1)
DButton16:SetSize(85, 30)
DButton16:SetPos(165, 265)
DButton16:SetText('Camera')
DButton16.DoClick = function() LocalPlayer():ConCommand("give gmod_camera") end
DButton15 = vgui.Create('DButton',DFrame1)
DButton15:SetSize(85, 30)
DButton15:SetPos(255, 230)
DButton15:SetText('Tool Gun')
DButton15.DoClick = function() LocalPlayer():ConCommand("give gmod_tool") end
DButton14 = vgui.Create('DButton',DFrame1)
DButton14:SetSize(85, 30)
DButton14:SetPos(165, 230)
DButton14:SetText('Physics Gun')
DButton14.DoClick = function() LocalPlayer():ConCommand("give weapon_physgun") end
DLabel1 = vgui.Create('DLabel',DFrame1)
DLabel1:SetPos(225, 40)
DLabel1:SetText('Weapons')
DLabel1:SizeToContents()
DLabel1:SetTextColor(Color(0, 0, 0, 255))
DButton12 = vgui.Create('DButton',DFrame1)
DButton12:SetSize(175, 40)
DButton12:SetPos(165, 300)
DButton12:SetText('Strip weapons')
DButton12.DoClick = function() end//ply:stripWeapons();
DButton11 = vgui.Create('DButton',DFrame1)
DButton11:SetSize(85, 30)
DButton11:SetPos(255, 195)
DButton11:SetText('TMP')
DButton11.DoClick = function() LocalPlayer():ConCommand("give weapon_tmp") end
DButton6 = vgui.Create('DButton',DFrame1)
DButton6:SetSize(85, 30)
DButton6:SetPos(165, 195)
DButton6:SetText('Pump shotgun')
DButton6.DoClick = function() LocalPlayer():ConCommand("give weapon_pumpshotgun") end
DButton10 = vgui.Create('DButton',DFrame1)
DButton10:SetSize(85, 30)
DButton10:SetPos(255, 125)
DButton10:SetText('Mac10')
DButton10.DoClick = function() LocalPlayer():ConCommand("give weapon_mac10") end
DButton5 = vgui.Create('DButton',DFrame1)
DButton5:SetSize(85, 30)
DButton5:SetPos(165, 125)
DButton5:SetText('M4')
DButton5.DoClick = function() LocalPlayer():ConCommand("give weapon_m4") end
DButton4 = vgui.Create('DButton',DFrame1)
DButton4:SetSize(85, 30)
DButton4:SetPos(165, 160)
DButton4:SetText('MP5')
DButton4.DoClick = function() LocalPlayer():ConCommand("give weapon_mp5") end
DButton9 = vgui.Create('DButton',DFrame1)
DButton9:SetSize(85, 30)
DButton9:SetPos(255, 90)
DButton9:SetText('Glock')
DButton9.DoClick = function() LocalPlayer():ConCommand("give weapon_glock") end
DButton3 = vgui.Create('DButton',DFrame1)
DButton3:SetSize(85, 30)
DButton3:SetPos(255, 160)
DButton3:SetText('Para')
DButton3.DoClick = function() LocalPlayer():ConCommand("give weapon_para") end
DButton2 = vgui.Create('DButton',DFrame1)
DButton2:SetSize(85, 30)
DButton2:SetPos(255, 55)
DButton2:SetText('Desert Eagle')
DButton2.DoClick = function() LocalPlayer():ConCommand("give weapon_deagle") end
DButton7 = vgui.Create('DButton',DFrame1)
DButton7:SetSize(85, 30)
DButton7:SetPos(165, 90)
DButton7:SetText('Fiveseven')
DButton7.DoClick = function() LocalPlayer():ConCommand("give weapon_fiveseven") end
DButton1 = vgui.Create('DButton',DFrame1)
DButton1:SetSize(85, 30)
DButton1:SetPos(165, 55)
DButton1:SetText('AK-47')
DButton1.DoClick = function() LocalPlayer():ConCommand("give weapon_ak47") end
[/lua]
[QUOTE=Cubar;25909185][lua]//rewritten[/lua][/QUOTE]
I tried this, and it gives me the same exact error.
[code][lua\singleplayer.lua:32] attempt to index global 'vgui' (a nil value)[/code]
Ok, I've done that:
[img]http://ahb.me/S8W[/img]
A bunch of stuff is disabled?
Add it to the autorun/client/ folder as thejjokerr said, yap you have to figure that out your self, it wouldn't be fun otherwise.
Alright..I'll figure this out but I'll bump the thread if anything [I]significant[/I] occurs. Thanks!
Seriously how retarded do you have to be to put derma in autorun/server
[img]http://img607.imageshack.us/img607/8103/derrrrr.png[/img]
Seriously how retarded do you have to be to realize I haven't Lua scripted before
Bonus:
[img]http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs342.snc4/41400_605607790_1713_n.jpg[/img]
nice hat
VeryNiceGuy why don't you read over some basic Lua tutorials before bothering people with stupid questions that have been answered many times before?
I already know Lua, it's just that my code stopped working after I re-saved it and then it was determined to be in the wrong folder, it has been fixed and here is the finale product:
[img_thumb]http://ahb.me/Scs[/img_thumb]
Theres this cool menu that comes up when you push Q that will do most that, especially the gun giving part
"I have nothing better to do so I will make fun of someones first Lua project"
i love you
you could make fun of mine all you wanted. They are probably easier to make fun of also
[editline]7th November 2010[/editline]
[QUOTE=VeryNiceGuy;25922106]Seriously how retarded do you have to be to realize I haven't Lua scripted before
Bonus:
[img_thumb]http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs342.snc4/41400_605607790_1713_n.jpg[/img_thumb]
nice hat[/QUOTE]
also wtf is that?
[QUOTE=c-unit;25926811]wtf is that?[/QUOTE]
it is you and your sister i assume
don't deny it, it'll only make it worse
I'm not sure where you found that picture of me and my boyfriend but delete it
[editline]7th November 2010[/editline]
also, my sister is fucking hot if that's her.
lol "it can't be me because i made a joke implying im gay"
cry cry cry
I'm not sure where you found that picture, but it is not me. Also stop getting your bitch Cubar to rate me dumb and you funny. This is how retarded you are:
Example A:
[QUOTE=VeryNiceGuy;25922106][b]Seriously how retarded do you have to be to realize [u]I haven't Lua scripted before[/b][/u]
[/QUOTE]
Example B:
[QUOTE=VeryNiceGuy;25925574][b][u]I already know Lua[/u][/b], it's just that my code stopped working after I re-saved it and then it was determined to be in the wrong folder, it has been fixed and here is the finale product: -snipped-
[/QUOTE]
Dumb faggot is dumb
[editline]8th November 2010[/editline]
Also you are a retard because you put derma in autorun/server/ trolololoo
[editline]8th November 2010[/editline]
[QUOTE=notRzilla;25924756]VeryNiceGuy why don't you read over some basic Lua tutorials before bothering people with stupid questions that have been answered many times before?[/QUOTE]
^ye.
[highlight](User was banned for this post ("Flaming" - Greeman))[/highlight]
I can assure you, you are both equally stupid:frogbon:
nou
[QUOTE=c-unit;25937399]Example B:[/QUOTE]
I meant, as in GLua. There's a slight difference, you know. Yes, the picture is you. Stop crying.
so you are saying that in example B you aleady know GLua, but in example A you do not?
[editline]8th November 2010[/editline]
and that is not me
I'm saying I haven't scripted for GMod but I know Lua. GLua ~= Lua.
[editline]900[/editline]
and that is you
Did you google my name? Or facebook it? If so you failed.. keep trying, or shall I link you to an actual picture?
[editline]8th November 2010[/editline]
[img]http://sphotos.ak.fbcdn.net/hphotos-ak-snc3/hs543.snc3/29752_385960013201_656243201_4132616_7842727_n.jpg[/img]
thats me
lol
[url]http://www.facebook.com/profile.php?id=656243201[/url]
Look in her friends:
[url]http://www.facebook.com/profile.php?id=605607790[/url]
^You.
The amount of idiocy projected from c-unit just made my day. Thanks, I don't need anymore help here by the way! :-)
It's funny how you are telling me who I am. I wouldn't lie if you actually found me. Also you are calling me an idiot when you go off, make a derma with Derma Designer, and put it in autorun/server. GG son.
[QUOTE=Godlike2;25949451]It's funny how you are telling me who I am. I wouldn't lie if you actually found me. Also you are calling me an idiot when you go off, make a derma with Derma Designer, and put it in autorun/server. GG son.[/QUOTE]
umad!
[QUOTE=Cubar;25953324]umad![/QUOTE]
nou
Sorry, you need to Log In to post a reply to this thread.