Hey Y'all
I am getting this error for when I try to get the SetViewOffset working on the job.
[ERROR] A runtime error has occurred in "addons/darkrpmodification/lua/darkrp_customthings/jobs.lua" on line 1307.
The best help I can give you is this:
bad argument #1 to 'SetViewOffset' (Vector expected, got number)
Hints:
- No hints, sorry.
The responsibility for the error above lies with (the authors of) one (or more) of these files:
1. addons/darkrpmodification/lua/darkrp_customthings/jobs.lua on line 1307
2. gamemodes/darkrp/gamemode/libraries/fn.lua on line 84
3. gamemodes/darkrp/gamemode/libraries/fn.lua on line 84
4. gamemodes/darkrp/gamemode/libraries/fn.lua on line 84
5. gamemodes/darkrp/gamemode/libraries/fn.lua on line 84
6. gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua on line 750
7. function 'Spawn'
8. gamemodes/base/gamemode/player.lua on line 115
This is the Job code
TEAM_AWOO = DarkRP.createJob("Momiji Inubashiri", {
color = Color(245, 143, 212, 255),
model = {"models/player/momiji_inubashiri.mdl"},
description = [[Momiji just wants to fit in with the other wolf girls. Awoo your way into the heart of everyone (Or with bullets)! ]],
weapons = {"unclen8_m98b", "notmic_mp7sil", "weapon_lightsaber", "csgo_falchion_ultraviolet", "pro_lockpick_update", "prokeypadcracker", "swep_pickpocket", "weapon_lightsaber", "weapon_vape_americanweapon_vape_american"},
command = "Awoo",
max = 2,
salary = 100,
admin = 0,
vote = false,
hasLicense = false,
candemote = false,
category = "Custom Jobs",
ammo = {
["smg1"] = 124,
["SniperPenetratedRound"] = 30
},
modelScale = 0.6,
PlayerSpawn = function(ply)
ply:SetHealth(150)
ply:SetArmor(20)
ply:SetViewOffset(Vector(0,0,50))
end
})
Either I am stupid or I am not understanding why this isn't working. I am searched for days on the answer and can't find anything. Maybe a Lua expert can help!
Thanks in advance!
@ByHero14051993
This causes an error though the entirety of jobs.
[ERROR] addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:1305: unexpected symbol near ','
1. unknown - addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:0
This would be Line 1305: ply:SetHealth(150),
Are you sure you posted the right job with the error? Looking at the original code, it looks completely fine in regards to the thrown error. Did you refresh your files?
I am sure because that is the line. As far as I know you should not have a comma in the PlayerSpawn function.
yeah no absolutely not. but that error should not be happening...since i have no other ideas, triple check the file with that in it is in the correct place, and that youre editing the right one, blah blah.
Sorry, you need to Log In to post a reply to this thread.