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 » Scripters
Home Search
 

FPS script not working?

Previous Thread :: Next Thread 
Ruinable is not online. Ruinable
Joined: 14 Sep 2014
Total Posts: 8903
05 Dec 2014 06:26 PM
It... it kind of works
come test it here. I just basically want the gun to aim wherever you're looking up and down, etc

http://www.roblox.com/Ruinables-Place-Number-27-place?id=185535274


local plr = game.Players.LocalPlayer
local Tool = script.Parent
local Mouse = plr:GetMouse()
repeat wait() until plr.Character
local Character = plr.Character
Mouse.TargetFilter = nil
Character.Torso.Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
Character.Torso.Neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
local Camera = game.Workspace.CurrentCamera

local Settings = {
OneHanded = false
,FakeArms = true
,FakeArmTransparency = 0
,RightPos = CFrame.new(-0.75, -0.25, 0.5) * CFrame.Angles(math.rad(-90), 0, 0)
,LeftPos = CFrame.new(1, 0.5, 0.5) * CFrame.Angles(math.rad(-90), math.rad(45), 0)
,AimPart = Tool.AimPart
,AimPartOffset = CFrame.new()
,AimGripOffset = Vector3.new(0, 0, 0)
,LeftAimPos = CFrame.new(1, 0.5, 0.5) * CFrame.Angles(math.rad(-100), math.rad(45), 0)
,Weld = true
}

local Arms_Made
local Fake_Arm_Right, Fake_Arm_Left, Fake_Arm_Model

Tool.Equipped:connect(function(Mouse)
if Character and not Arms_Made then
Arms_Made = true
local Torso = Character.Torso
Torso["Right Shoulder"].Part1 = nil
Left_Weld = Instance.new("Weld", Torso)
Left_Weld.Name = "Left_Weld"
Left_Weld.Part0 = Character.Head
Left_Weld.C0 = CFrame.new(0, -1.5, 0)
if not Settings.OneHanded then
Torso["Left Shoulder"].Part1 = nil
Left_Weld.Part1 = Character["Left Arm"]
end
Right_Weld = Instance.new("Weld", Torso)
Right_Weld.Name = "Right_Weld"
Right_Weld.Part0 = Character.Head
Right_Weld.Part1 = Character["Right Arm"]
Right_Weld.C0 = CFrame.new(0, -1.5, 0)
Left_Weld.C1 = Settings.LeftPos
Right_Weld.C1 = Settings.RightPos
end
if Settings.FakeArms and not Fake_Arm_Right then
Fake_Arm_Right, Fake_Arm_Left = Character["Right Arm"]:Clone(), Character["Left Arm"]:Clone()
Fake_Arm_Right.FormFactor, Fake_Arm_Left.FormFactor = "Custom", "Custom"
Fake_Arm_Right.Size, Fake_Arm_Left.Size = Vector3.new(), Vector3.new()
local fakeArms = {Fake_Arm_Right, Fake_Arm_Left}
for i = 1, 2 do
local w = Instance.new("Weld", fakeArms[i])
w.Part0 = Character[fakeArms[i].Name]
w.Part1 = fakeArms[i]
fakeArms[i].Transparency = Settings.FakeArmTransparency
end
Fake_Arm_Model = Instance.new("Model", Camera)
Fake_Arm_Right.Parent = Fake_Arm_Model
if not Settings.OneHanded then
Fake_Arm_Left.Parent = Fake_Arm_Model
end
Fake_Arm_Model.Name = "FakeArms"
if Settings.CharacterMeshes then
for i, v in pairs(Character:GetChildren()) do
if v:IsA("CharacterMesh") and v.BodyPart == Enum.BodyPart.LeftArm or v:IsA("CharacterMesh") and v.BodyPart == Enum.BodyPart.RightArm then
v:Clone().Parent = Fake_Arm_Model
end
end
end
if Character:FindFirstChild("Shirt") then
Instance.new("Humanoid", Fake_Arm_Model)
Character.Shirt:Clone().Parent = Fake_Arm_Model
else
local Arm_Mesh = Instance.new("SpecialMesh", Fake_Arm_Right)
Arm_Mesh.MeshType, Arm_Mesh.Scale = "Brick", Vector3.new(5, 10, 5)
local Arm_Mesh2 = Instance.new("SpecialMesh", Fake_Arm_Left)
Arm_Mesh2.MeshType, Arm_Mesh2.Scale = "Brick", Vector3.new(5, 10, 5)
end
end
end)

Mr. Mustachio | ( ͡°╭͜ʖ╮͡° )
Report Abuse
nomer888 is not online. nomer888
Joined: 13 Feb 2010
Total Posts: 551
05 Dec 2014 06:30 PM
[player's character here].Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.Angles([player's mouse here].UnitRay.Direction.Y + math.pi/2, math.pi, 0)

Then, weld the fake arms to the head.
Report Abuse
Ruinable is not online. Ruinable
Joined: 14 Sep 2014
Total Posts: 8903
05 Dec 2014 06:32 PM
Tool.Equipped:connect(function(Mouse)
Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.Angles(Mouse.UnitRay.Direction.Y + math.pi/2, math.pi, 0)

?

Mr. Mustachio | ( ͡°╭͜ʖ╮͡° )
Report Abuse
Ruinable is not online. Ruinable
Joined: 14 Sep 2014
Total Posts: 8903
05 Dec 2014 06:36 PM
current script
still doesn't work



local plr = game.Players.LocalPlayer
local Tool = script.Parent
local Mouse = plr:GetMouse()
repeat wait() until plr.Character
local Character = plr.Character
Mouse.TargetFilter = nil
Character.Torso.Neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
Character.Torso.Neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
local Camera = game.Workspace.CurrentCamera

local Settings = {
OneHanded = false
,FakeArms = true
,FakeArmTransparency = 0
,RightPos = CFrame.new(-0.75, -0.25, 0.5) * CFrame.Angles(math.rad(-90), 0, 0)
,LeftPos = CFrame.new(1, 0.5, 0.5) * CFrame.Angles(math.rad(-90), math.rad(45), 0)
,AimPart = Tool.AimPart
,AimPartOffset = CFrame.new()
,AimGripOffset = Vector3.new(0, 0, 0)
,LeftAimPos = CFrame.new(1, 0.5, 0.5) * CFrame.Angles(math.rad(-100), math.rad(45), 0)
,Weld = true
}

local Arms_Made
local Fake_Arm_Right, Fake_Arm_Left, Fake_Arm_Model

Tool.Equipped:connect(function(Mouse)
Character.Torso.Neck.C0 = CFrame.new(0, 1, 0) * CFrame.Angles(Mouse.UnitRay.Direction.Y + math.pi/2, math.pi, 0)
if Character and not Arms_Made then
Arms_Made = true
local Torso = Character.Torso
Torso["Right Shoulder"].Part1 = nil
Left_Weld = Instance.new("Weld", Torso)
Left_Weld.Name = "Left_Weld"
Left_Weld.Part0 = Character.Head
Left_Weld.C0 = CFrame.new(0, -1.5, 0)
if not Settings.OneHanded then
Torso["Left Shoulder"].Part1 = nil
Left_Weld.Part1 = Character["Left Arm"]
end
Right_Weld = Instance.new("Weld", Torso)
Right_Weld.Name = "Right_Weld"
Right_Weld.Part0 = Character.Head
Right_Weld.Part1 = Character["Right Arm"]
Right_Weld.C0 = CFrame.new(0, -1.5, 0)
Left_Weld.C1 = Settings.LeftPos
Right_Weld.C1 = Settings.RightPos
end
if Settings.FakeArms and not Fake_Arm_Right then
Fake_Arm_Right, Fake_Arm_Left = Character["Right Arm"]:Clone(), Character["Left Arm"]:Clone()
Fake_Arm_Right.FormFactor, Fake_Arm_Left.FormFactor = "Custom", "Custom"
Fake_Arm_Right.Size, Fake_Arm_Left.Size = Vector3.new(), Vector3.new()
local fakeArms = {Fake_Arm_Right, Fake_Arm_Left}
for i = 1, 2 do
local w = Instance.new("Weld", fakeArms[i])
w.Part0 = Character[fakeArms[i].Name]
w.Part1 = fakeArms[i]
fakeArms[i].Transparency = Settings.FakeArmTransparency
end
Fake_Arm_Model = Instance.new("Model", Camera)
Fake_Arm_Right.Parent = Fake_Arm_Model
if not Settings.OneHanded then
Fake_Arm_Left.Parent = Fake_Arm_Model
end
Fake_Arm_Model.Name = "FakeArms"
if Settings.CharacterMeshes then
for i, v in pairs(Character:GetChildren()) do
if v:IsA("CharacterMesh") and v.BodyPart == Enum.BodyPart.LeftArm or v:IsA("CharacterMesh") and v.BodyPart == Enum.BodyPart.RightArm then
v:Clone().Parent = Fake_Arm_Model
end
end
end
if Character:FindFirstChild("Shirt") then
Instance.new("Humanoid", Fake_Arm_Model)
Character.Shirt:Clone().Parent = Fake_Arm_Model
else
local Arm_Mesh = Instance.new("SpecialMesh", Fake_Arm_Right)
Arm_Mesh.MeshType, Arm_Mesh.Scale = "Brick", Vector3.new(5, 10, 5)
local Arm_Mesh2 = Instance.new("SpecialMesh", Fake_Arm_Left)
Arm_Mesh2.MeshType, Arm_Mesh2.Scale = "Brick", Vector3.new(5, 10, 5)
end
end
end)

Mr. Mustachio | ( ͡°╭͜ʖ╮͡° )
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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