SolvedWhy does this script doesn't work

Posts 19 of 9 · Page 1 of 1
Why does this script doesn't work
Im new to Lua scripting, im trying to find any kind of exploit on this DarkRP server im playing on, i used scripthook and found this code on server, tried to execute it i get this error:

[ERROR] init.lua:3: attempt to index global 'ply' (a nil value)
this is the code:

Code:
net.Start("_XMASPopUp")
local cash = math.random(1000,10000)
ply:AddMoney(cash)
net.WriteString("You got $" .. tostring(cash) .. " Enjoy!")
net.WriteString("models/props/cs_assault/Money.mdl")
net.Send(ply)
ply is local player so at the top make local ply = LocalPlayer
Quote Originally Posted by p100 body shot View Post
ply is local player so at the top make local ply = LocalPlayer
local ply = LocalPlayer
net.Start("_XMASPopUp")
local cash = math.random(9999999,99999999)
ply:AddMoney(cash)
net.WriteString("You got $" .. tostring(cash) .. " Enjoy!")
net.WriteString("models/props/cs_assault/Money.mdl")
net.Send(ply)
Actually it's LocalPlayer()

But still after that I get this error:
[ERROR] init.lua:4: attempt to call method 'AddMoney' (a nil value)
I tried it with Give and AddItem but still same error.
Yeah dude, executing server code is how you exploit a addon!!
Code:
local cash = 1000000; // gives you 1mil per run
local ply = LocalPlayer();
ply:AddMoney(cash)
net.Start("_XMASPopUp")
print("You HACKED $" .. tostring(cash) .. " into Garry's Modification, enjoy hackerfucker")
net.SendToServer()
// Remember to thank me (Scetch08) because apparently net exploits are hard.
Something of the sort, print is optional.
Quote Originally Posted by Scetch08 View Post
Yeah dude, executing server code is how you exploit a addon!!
Code:
local cash = 1000000; // gives you 1mil per run
local ply = LocalPlayer();
ply:AddMoney(cash)
net.Start("_XMASPopUp")
print("You HACKED $" .. tostring(cash) .. " into Garry's Modification, enjoy hackerfucker")
net.SendToServer()
// Remember to thank me (Scetch08) because apparently net exploits are hard.
Something of the sort, print is optional.
Code:
[ERROR] init.lut:3: attempt to call method 'AddMoney' (a nil value)
Copy and pasting won't get you anywhere, also you could check how AddMoney is defined.
The original function was clearly a serverside script, modifying it to use client side functions won't make it work. In short, this isn't an exploit, it's the server setting a players money and then sending a net message notifying them of how much money they received.
Been a week since OP has responded, assuming solved.

/Closed.
Posts 19 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?