|
| 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 |
|