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
 

[ Content Deleted ]

Previous Thread :: Next Thread 
WAATERMELON is not online. WAATERMELON
Joined: 03 Jul 2014
Total Posts: 921
05 Apr 2015 12:27 PM
[ Content Deleted ]
Report Abuse
WAATERMELON is not online. WAATERMELON
Joined: 03 Jul 2014
Total Posts: 921
05 Apr 2015 05:56 PM
[ Content Deleted ]
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
05 Apr 2015 05:58 PM
Messing with the joint motors.


I script -~ chimmihc
Report Abuse
WAATERMELON is not online. WAATERMELON
Joined: 03 Jul 2014
Total Posts: 921
05 Apr 2015 06:02 PM
[ Content Deleted ]
Report Abuse
Tuneable is not online. Tuneable
Joined: 16 Feb 2013
Total Posts: 2932
05 Apr 2015 06:08 PM
Hacky but works

repeat wait(1) until game.Players.LocalPlayer
repeat wait(1) until game.Players.LocalPlayer.Character

local Workspace = workspace
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Tool = script.Parent
local Head = Character:WaitForChild("Head")
local Camera = Workspace.CurrentCamera
local Torso = Character:WaitForChild("Torso")
local Equipped = false

local RenderStepped

local ArmPart = Character.Torso:clone()
ArmPart:ClearAllChildren()
ArmPart.Transparency = 1
ArmPart.Name = "FakeTorso"

local FakeHead = Character.Head:clone()
FakeHead:ClearAllChildren()
FakeHead.Name = "FakeHead"
FakeHead.FormFactor = "Custom"
FakeHead.Transparency = 1
FakeHead.Size = Vector3.new(.1, .1, .1)

Tool.Equipped:connect(function(Mouse)
Equipped = true

ArmPart.Parent = Character
FakeHead.Parent = Character

Character.Torso["Right Shoulder"].Part0 = ArmPart
Character.Torso["Left Shoulder"].Part0 = ArmPart

local ArmWeld = Instance.new("Weld", ArmPart)
ArmWeld.Part0 = ArmPart
ArmWeld.Part1 = FakeHead
ArmWeld.C0 = CFrame.new(0, 2, 0)

local HeadWeld = Instance.new("Weld", FakeHead)
HeadWeld.Part0 = Torso
HeadWeld.Part1 = FakeHead
HeadWeld.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
HeadWeld.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)

while (Equipped == true) do
game:GetService("RunService").RenderStepped:wait()
HeadWeld.C0 = CFrame.new(0, 1.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) * CFrame.Angles(-math.asin(Camera.CoordinateFrame.lookVector.Y) ,0, 0)
end
end)

Tool.Unequipped:connect(function()
Equipped = false
ArmPart.Parent = nil
FakeHead.Parent = nil

Character.Torso["Right Shoulder"].Part0 = Torso
Character.Torso["Left Shoulder"].Part0 = Torso
end)
Report Abuse
MarvinTheMelon is not online. MarvinTheMelon
Joined: 14 Jan 2012
Total Posts: 1850
05 Apr 2015 06:16 PM
Your name makes me m0ist @OP
Report Abuse
WAATERMELON is not online. WAATERMELON
Joined: 03 Jul 2014
Total Posts: 921
05 Apr 2015 08:00 PM
[ Content Deleted ]
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
05 Apr 2015 08:02 PM
Look into some of these scripts I made:

http://www.roblox.com/ViewModel-item?id=225498799
http://www.roblox.com/Realism-Mode-Script-item?id=189240277
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
05 Apr 2015 08:05 PM
This one is fun. You need to make the bottom surface point at the mouse, but you also need to manage the weld correctly. Fun time. Let's get started!

We first need to make a function to point the bottom surface at a position.

function PointBottomSurface(Pos, LookAt)
local Up = Vector3.new(0,1,0);
local DirectionToLookAt = (LookAt-Pos).unit;

if (DirectionToLookAt.Y > 0.98) then
-- This means the direction to look at is the same as the 'Up'
-- This won't work. Let's just change the 'Up' to something else
Up = Vector3.new(1,0,0);
end

local XAxis = DirectionToLookAt:Cross(Up)
local Up = XAxis:Cross(DirectionToLookAt);
return CFrame.new(
Pos.X,Pos.Y,Pos.Z,
-XAxis.X,-DirectionToLookAt.X,-Up.X,
-XAxis.Y,-DirectionToLookAt.Y,-Up.Y,
-XAxis.Z,-DirectionToLookAt.Z,-Up.Z
);
end

Now we simply need to make the line of code that uses that function, and turns the resulting CFrame into object-space to work with the "Right Shoulder" weld.

local RightShoulder = Player.Character.Torso['Right Shouldern'];
Game:GetService("RunService").RenderStepped:connect(function()
RightShoulder.C1 = (PointBottomSurface(RightShoulder.Part1.Position, Mouse.Hit.p)):toObjectSpace(RightShoulder.Part0.CFrame * RightShoulder.C0)
end)

Combining all that, this will point the arm at the mouse.
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