In my LocalScript I get this weird error:
16:27:41.566 - Players.Player1.PlayerGui.Console2.Console.Input.LocalScript:39: attempt to perform arithmetic on field 'x' (a nil value)
But I don't know why...
My code:
local yesTime = 5
local yes = false
local chanceIP, chanceVirus, chanceFirewall, chanceTrace, chanceNetwork, chanceRemote, chancePhysical, chanceStealth, chanceLocal, chanceCracker, chanceLevel
local Skills = {
["IP"] = 1,
["virus"] = 1,
["firewall"] = 1,
["trace"] = 1,
["network"] = 1,
["remote"] = 1,
["physical"] = 1,
["stealth"] = 1,
["Local"] = 1,
["cracker"] = 1,
["level"] = 1
}
local function chance(x)
local rndmNeedWork = math.random(50)
rndmNeedWork = rndmNeedWork * Skills.x - Skills.x
if rndmNeedWork > 30 then
yes = true
wait(yesTime)
yes =false
end
end
while true do
wait(0.1)
chance("IP")
end
All help appreciated!

6 comments
What is x supposed to be? An element in the dictionary?
Yeah
Dictionary keys that are named have to be accessed by said names, this will be more difficult to implement then what you currently have. Also, dictionary/table keys are accessed by doing: thing[index]
Well I still need help....
maybe define x as something?
that wouldn't work because then it would read what you assigned it to in the function not what the player types is the parameters