[QUOTE=brocko;22118703]It's not going to be clientside, since the hook is serverside and will be in sv/hooks.lua. You can't change it to F6 unfortunately.[/QUOTE]
[lua]hook.Add("Think" , "KeyPressed" , function()
if LocalPlayer():KeyDown(KEY_F6) then
print("Hey, F6 is pressed")
end
end )
[/lua]
[QUOTE=|FlapJack|;22119498][lua]hook.Add("Think" , "KeyPressed" , function()
if LocalPlayer():KeyDown(KEY_F6) then
print("Hey, F6 is pressed")
end
end )
[/lua][/QUOTE]
Thank you so much, but what is the function to make the menu open instead of it just saying "Hey, F6 is pressed."
-Also I'm having a bit of troubles with this. I stuck it in my addons folder for my server, and I can view the shop and everything, problem is that it doesn't do anything when I try to buy something. It doesn't give a console error and points are not used up, if you got any ideas that would be great! (Doesn't work in SoloPlay either)
[QUOTE=Diet Taco;22124275]Thank you so much, but what is the function to make the menu open instead of it just saying "Hey, F6 is pressed."
-Also I'm having a bit of troubles with this. I stuck it in my addons folder for my server, and I can view the shop and everything, problem is that it doesn't do anything when I try to buy something. It doesn't give a console error and points are not used up, if you got any ideas that would be great! (Doesn't work in SoloPlay either)[/QUOTE]
You would call the function in which your derma menu is created.. Or just create the Derma menu in the if statement for the IsKeyDown statement Flap just wrote..
In my clientside script im adding LocalPlayer():GetPoints() and it just gives me an error, I cant remember the error sorry about that.
GetPoints is serverside I think.
[editline]06:14AM[/editline]
use PointMod.Points on the client
Suggestion:
How about unlocking sTools and entinies
(So players in my server can unlock stuff like Waterizer and Combine Mech)
How can i make that points restart each time that we change map ?
[editline]10:39PM[/editline]
And 1 more question , how do i add this to a gamemode ? like Zombie Survival
[editline]11:05PM[/editline]
and how to make that when u buy something you dont have to respawn to get the item , you get it automatically
Does anyone know if it is possible to make triggers inside a map that trigger points?
I want to make a start and end trigger, once you trigger both in order you get points.
awesome!!!! i have been looking so much for this!!!! But can it sell sweps?
Edit : GARRYS MOD.ORG IS BEING MIRRORED!!! SO I CANT DOWNLOAD IT!!! NOOOOO!!! I WANT IT SO MUCH!!!
Edit : Its back up!!! downloading this smexy mod.
How would i go about adding an item in the mod so when people buy a trial, there's a trial
also how do i add entites and sweps to the player? Please show my a basic hook code for it, thank you
How do you earn points? Is it just by admins giving you points?
This looks very interesting, but I'm still not understanding if I wanted to spawn a prop or something such as a weapon or functional items.
So, How would I add;
[CODE]
[LIST=1]
[*]local PointsToGive = 10
[*]timer.Create( "GivePoints", 300, 0, function()
[*] for k, v in ipairs( player.GetAll() ) do
[*] v:GivePoints( PointsToGive )
[*] end
[*]end )
[/LIST]
[/CODE]
Do I make a new Lua file in Auto-run, or what.
[QUOTE=Barracuda;23688956]
Do I make a new Lua file in Auto-run, or what.[/QUOTE]
[lua]
local PointsToGive = 10
timer.Create( "GivePoints", 300, 0, function()
for k, v in ipairs( player.GetAll() ) do
v:GivePoints( PointsToGive )
end
end )
[/lua]
Put it into sv/hooks.lua
So, does anyone know how to make it spawn weapons or usable items on front of the player when they click on the item?
Doesn't work, I keep getting this error:
[code]
addons\pointmod\lua\pointmod\cl\menu.lua:54: bad argument #1 to 'pairs' (table expected, got nil)
[/code]
The Addon works fine for me accept there is one major bug when my friend join the server and presses f2 it will break the store i have no idea why its only him who breaks it
he reinstalled the game twice and also removed his data from sv.db and still get the same problem
[QUOTE=jaythorpe;24090243]The Addon works fine for me accept there is one major bug when my friend join the server and presses f2 it will break the store i have no idea why its only him who breaks it
he reinstalled the game twice and also removed his data from sv.db and still get the same problem[/QUOTE]
Yeah, this happens to me too. I get the error taht I last posted
Ok lets say for example I want to buy a fusion reactor for 1000 points, what do I put in the item.lua?
[code]
PointMod.Items[1] = { "Fusion Reactor", "Buy a Fusion Reactor", "???", "???", 1000, "PlayerLoadout", function( ply )
ply:Give( "???" )
end }
[/code]
I was making something similar to this, yours is far better though
Nice work.
Snipped my post thinking I was replying to a 3 month old post... /facepalm.
[QUOTE=ROFLBURGER;23999217]Doesn't work, I keep getting this error:
[code]
addons\pointmod\lua\pointmod\cl\menu.lua:54: bad argument #1 to 'pairs' (table expected, got nil)
[/code][/QUOTE]
Check line 54 and make sure that the table it is using isnt empty.
Quick question guys. I want to use this with Derp NPC Buyers so that whenever someone sells something to a NPC, they gain a point. How would i do this? I think (And i could be wrong) the following code is what i'd need but how do i create it within a hook?
[lua]
if ent:GetClass() == tab.entclass then
if tab.requiredmodel and ent:GetModel() != tab.requiredmodel then
return
[/lua]
If anyone knows that the above code would work could they just confirm it?
Thanks!
I was wondering how to add noclip to the buy menu, since on my server I want to be able to have it so you have to buy noclip, you cant just press the noclip button?
[QUOTE=masterwolf;24301284]I was wondering how to add noclip to the buy menu, since on my server I want to be able to have it so you have to buy noclip, you cant just press the noclip button?[/QUOTE]
[lua]
PointMod.Items[8] = { "Noclip", "Have the ability to use noclip!", "models/Gibs/HGIBS.mdl", "noclip", 100, "PlayerNoClip", function( ply )
return true
end, false }
[/lua]
[QUOTE=CombineGuru;24303231][lua]
PointMod.Items[8] = { "Noclip", "Have the ability to use noclip!", "models/Gibs/HGIBS.mdl", "noclip", 100, "PlayerNoClip", function( ply )
return true
end, false }
[/lua][/QUOTE]
Hey I just put it into the items.lua and it didn't add anything. Where you say PointMod.Items[8] do you think its because there is already an [8] on another item? I'm no lua genious but should I change it to 11, then where it has all the arguments and an 11?
How can I make it so after a player buys an item, they'll get it whenever they spawn, and when they leave the game, they lose it and have to rebuy it?
Also, how would I add entities and vehicles?
how can i make it like it gives 50 point every 10 min?
[QUOTE=Siemz;24416141]how can i make it like it gives 50 point every 10 min?[/QUOTE]
Read the thread next time..
[lua]
local PointsToGive = 10
timer.Create( "GivePoints", 300, 0, function()
for k, v in ipairs( player.GetAll() ) do
v:GivePoints( PointsToGive )
end
end )
[/lua]
lua/autorun/server/dasdasd.lua
[QUOTE=Trivkz;24416326]Read the thread next time..
[lua]
local PointsToGive = 10
timer.Create( "GivePoints", 300, 0, function()
for k, v in ipairs( player.GetAll() ) do
v:GivePoints( PointsToGive )
end
end )
[/lua]
lua/autorun/server/dasdasd.lua[/QUOTE]
i cannot found the file in my SRCDS
[editline]09:28PM[/editline]
i mean i cannot find the map . lua/autorun ( from here )
there only is client , and 2 other files :S
If the folder is not there make it.
Sorry, you need to Log In to post a reply to this thread.