generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Tables...

Previous Thread :: Next Thread 
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
22 Jul 2011 02:46 PM
Output:

Line 160: Attempt to index 'Set' (a nil value)


I don't get why it's a nil values, because all the varriables are set :l
I marked off all the lines you need to look at.



Version = "00.00.01"

-- VERSION CLASSIFICATION:
-- First Digits:
-- Major Updates
-- Second Digits exceeded 99

-- Second Digits:
-- Minor Updates / Major Fixes
-- Third Digits exceeded 99

-- Third Digits:
-- Minor Fixes
-- Other

Workspace = Game:GetService("Workspace")
Players = Game:GetService("Players")
Debris = Game:GetService("Debris")

ArmsDisabled = false
MouseDown = false

Modes = { -- This
Default = { "Laser Arm", "Spikes", "Shield" };
DualArm = { "Laser Arm", "Fly" };
}
mSet = 1 -- This
mNum = 1 -- This

local RingMesh = Instance.new("SpecialMesh")
RingMesh.MeshId = "http://www.roblox.com/asset/?id=3270017"

local CrownMesh = Instance.new("SpecialMesh")
CrownMesh.MeshId = "http://www.roblox.com/Asset/?id=20329976"

Table = {
["Insert"] = function(Table, Argument)
local Index = #Table
Index = Index + 1
Table[Index] = Argument
end;
["Remove"] = function(Table, Argument)
for Index, Value in pairs(Table) do
if (Value == Argument) then
Table[Index] = nil
break
end
end
end;
["Find"] = function(Table, Argument)
local Bool = false
local Returning = nil

for Key, Value in pairs(Table) do
if (Value == Argument) then
Bool = true
Returnign = Value
end
end

return Bool, Returning
end;
["Clear"] = function(Table)
Table = {}
end;
}

function Userdata(Parent, Child)
if (not Parent or not Child) then return end

local ret = Parent:findFirstChild(Child)
if (ret) then
return ret
else
error(tostring(Child).." is not a valid member of "..tostring(Parent), 1)
end

Parent.ChildAdded:connect(function(child)
if (child.Name == Child) then
return ret
end
end)
end

Joints = {}

function DisableLimbs()
LeftShoulder.Part1 = nil
RightShoulder.Part1 = nil

ArmsDisabled = true
end

function EnableLimbs()
for _, Limb in pairs(Joints) do
Limb.Parent = nil
end

LeftShoulder.Part1 = LeftArm
RightShoulder.Part1 = RightArm

ArmsDisabled = false
end

function CreateFakeArms()
if (ArmsDisabled) then
local NewLeft, NewRight

NewLeft = Instance.new("Weld", Torso)
NewRight = Instance.new("Weld", Torso)

NewLeft.Part0 = Torso
NewRight.Part0 = Torso

NewLeft.Part1 = LeftArm
NewRight.Part1 = RightArm

NewLeft.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
NewRight.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)

NewLeft.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
NewRight.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)

Table.Insert(Joints, NewLeft)
Table.Insert(Joints, NewRight)

return NewLeft, NewRight
end
end

function ArmPoint(Arm, Weld, EndCf)
-- Thanks to DarkShadow6 for his Arm Pointing formula

if (Arm:lower():match("right")) then
Weld.C0 = CFrame.new(1.5, 0.5, 0)
Weld.C1 = CFrame.Angles(math.rad(-90), 0, 0) * CFrame.new(0, 0, 0.5)
Weld.C1 = Weld.C1 * (CFrame.new((Torso.CFrame * CFrame.new(1.5, 0, 0)).p, EndCf.p) - (Torso.CFrame * CFrame.new(1.5, 0, 0)).p):inverse()
Weld.C1 = Weld.C1 * (Torso.CFrame - Torso.CFrame.p)

elseif (Arm:lower():match("left")) then
Weld.C0 = CFrame.new(-1.5, 0.5, 0)
Weld.C1 = CFrame.Angles(math.rad(-90), 0, 0) * CFrame.new(0, 0, 0.5)
Weld.C1 = Weld.C1 * (CFrame.new((Torso.CFrame * CFrame.new(-1.5, 0, 0)).p, EndCf.p) - (Torso.CFrame * CFrame.new(-1.5, 0, 0)).p):inverse()
Weld.C1 = Weld.C1 * (Torso.CFrame - Torso.CFrame.p)

end
end

function MouseUp(mouse)
local Set = Modes[mSet]
local Mode = Set[mNum]

MouseDown = false

EnableLimbs()
end

function MouseClick(mouse)
local Set = Modes[Default] -- Line 159
local Mode = Set["Laser Arm"] -- Line 160

MouseDown = true

local Left, Right = CreateFakeArms()
Left.Parent = nil

if (Mode ~= nil and Set ~= nil and Mode ~= "" and Set ~= "") then
if (Mode == "Laser Arm" and mSet == 1) then
DisableLimbs()

while (MouseDown and Right.Parent ~= nil) do
ArmPoint("Right", Right, mouse.Hit)

wait()
end
else
Workspace.Base:Remove()
end
else
Workspace.Base:Remove()
end
end

function SelectUFC(mouse)

mouse.Button1Down:connect(function() MouseClick(mouse) end)
mouse.Button1Up:connect(function() MouseUp(mouse) end)

end

Player = Players.LocalPlayer
Character = Player.Character

Backpack = Userdata(Player, "Backpack")
PlayerGui = Userdata(Player, "PlayerGui")

Head = Userdata(Character, "Head")
Torso = Userdata(Character, "Torso")
LeftArm = Userdata(Character, "Left Arm")
RightArm = Userdata(Character, "Right Arm")
LeftLeg = Userdata(Character, "Left Leg")
RightLeg = Userdata(Character, "Right Leg")

LeftShoulder = Userdata(Torso, "Left Shoulder")
RightShoulder = Userdata(Torso, "Right Shoulder")
LeftHip = Userdata(Torso, "Left Hip")
RightHip = Userdata(Torso, "Right Hip")

if (script.Parent.className ~= "HopperBin") then
local HopperBin = Instance.new("HopperBin", Backpack)
HopperBin.Name = "UFC " .. Version

script.Parent = HopperBin
end

local UFC = script.Parent

UFC.Selected:connect(SelectUFC)
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
22 Jul 2011 02:46 PM
Oh... Line 159 and 160 should be this:

local Set = Modes[mSet]
local Mode = Set[mNum]
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
22 Jul 2011 02:52 PM
Bump....
Report Abuse
benningtonguy is not online. benningtonguy
Joined: 21 Dec 2008
Total Posts: 18166
22 Jul 2011 02:55 PM
thanks.
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
22 Jul 2011 02:55 PM
Thanks for... what?
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
22 Jul 2011 02:57 PM
Where is someone advanced when you need them >:l
Report Abuse
benningtonguy is not online. benningtonguy
Joined: 21 Dec 2008
Total Posts: 18166
22 Jul 2011 03:00 PM
I did not find table Set.
Report Abuse
benningtonguy is not online. benningtonguy
Joined: 21 Dec 2008
Total Posts: 18166
22 Jul 2011 03:02 PM
local Set = Modes[Default]
local Mode = Set["Laser Gun"] --or whatever.



Uses no variables; very unefficient.
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
22 Jul 2011 03:10 PM
I already tried that. Still didn't work.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image