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
 

Re: Simple animation wont work as expected.

Previous Thread :: Next Thread 
Infocus is online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
02 Feb 2013 11:43 PM
--On the first for loop, whenever I add on to its CFrame, it moves weld.Part1 instead of weld.Part0..
How can I fix that?


plyr = game.Players.LocalPlayer
char = plyr.Character
torso = char.Torso
head = char.Head

limb = {char:findFirstChild("Right Arm")}

hop = Instance.new("HopperBin", plyr.Backpack)
hop.Name = "Test"
hop.Selected:connect(function(mouse)
mouse.KeyDown:connect(function(key)
if key == "p" then
hi = Instance.new("Part", workspace)
hi.TopSurface = 0
hi.BottomSurface = 0
hi.Anchored = false
hi.formFactor = "Custom"
hi.Shape = "Ball"
hi.Transparency = 1
hi.Size = Vector3.new(1.2, 1.2, 1.2)

weld = Instance.new("Weld", limb[1])
weld.Part0 = limb[1]
weld.Part1 = hi
weld.C0 = weld.C0 * CFrame.new(0, -1.5, 0)

for i = 1, 20 do
wait()
weld.C0 = weld.C0 * CFrame.new(0,0,0)
end

for v = 1, 10 do
wait()
hi.Transparency = hi.Transparency - .1
end

for w = 5, 1 do
wait()
limb[1].C0 = limb[1].C0 * CFrame.new(-.1, 0, 0)
end

char.Humanoid.WalkSpeed = 20
wait(10)

char.Humanoid.WalkSpeed = 16

end
end)
end)
Report Abuse
Infocus is online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
02 Feb 2013 11:49 PM
--Added a wait after first for loop. Still doesnt make a dif.

plyr = game.Players.LocalPlayer
char = plyr.Character
torso = char.Torso
head = char.Head

limb = {char:findFirstChild("Right Arm")}

hop = Instance.new("HopperBin", plyr.Backpack)
hop.Name = "Test"
hop.Selected:connect(function(mouse)
mouse.KeyDown:connect(function(key)
if key == "p" then
hi = Instance.new("Part", workspace)
hi.TopSurface = 0
hi.BottomSurface = 0
hi.Anchored = false
hi.formFactor = "Custom"
hi.Shape = "Ball"
hi.Transparency = 1
hi.Size = Vector3.new(1.2, 1.2, 1.2)

weld = Instance.new("Weld", limb[1])
weld.Part0 = limb[1]
weld.Part1 = hi
weld.C0 = weld.C0 * CFrame.new(0, -1.5, 0)

for i = 1, 20 do
wait()
weld.C0 = weld.C0 * CFrame.new(.1,0,0)
weld.C1 = weld.C1 * CFrame.new(.1, 0, 0)
end

for v = 1, 10 do
wait()
hi.Transparency = hi.Transparency - .1
end

wait(2)

for w = 20, 1 do
wait()
weld.C0 = weld.C0 * CFrame.new(-.1, 0, 0)
end

char.Humanoid.WalkSpeed = 20
wait(10)

char.Humanoid.WalkSpeed = 16

end
end)
end)
Report Abuse
lordsheen is not online. lordsheen
Joined: 24 Oct 2008
Total Posts: 608
03 Feb 2013 12:06 AM
--[[Simple anim templ8 I got a while back from a friend...]]

if key == "j" then

for i = 90,140,10 do wait()

weld.C1 =weld.C1*CFrame.new(1.4,.8,0)*CFrame.Angles(math.rad(i),2,0)

end

end
Report Abuse
lordsheen is not online. lordsheen
Joined: 24 Oct 2008
Total Posts: 608
03 Feb 2013 12:17 AM
--[[Terrible Rasengan...]]
me = game.Players.LocalPlayer.Name
Player = game.Players[me]

if (script.Parent.className ~= "HopperBin") then
Tool = Instance.new("HopperBin")
Tool.Parent = Player.Backpack
Tool.Name = "Rasengan"
script.Parent = Tool
end
Bin = script.Parent

damage = 20

function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
if (humanoid.Parent ~= Player.Character) then
Player.Character.Rasengan.archivable = false
humanoid.Health = humanoid.Health - damage
humanoid.Sit=true
Explosion=Instance.new("Explosion",Player.Character.Rasengan)
Explosion.BlastPressure = 0
Explosion.Position=Player.Character.Rasengan.Position
end
end
end
Bin.Selected:connect(function(mouse)
mouse.Button1Down:connect(function()




char = game.Players[me].Character
char.Torso["Right Shoulder"]:Remove()
local Motor = Instance.new("Motor")
Motor.Parent = char["Torso"]
Motor.Name = "Right Top"
Motor.Part0 = char["Torso"]
Motor.Part1 = char["Right Arm"]
Motor.C0 = CFrame.new(0.75,0.5,0) * CFrame.Angles(0,math.pi/2,0)
Motor.C1 = CFrame.new(-0.75,0.5,0) * CFrame.Angles(0,math.pi/2,0)
Motor.MaxVelocity = 0.1
Motor.DesiredAngle = math.pi/2

h = char["Right Arm"]
P = Instance.new("Part",char)
P.Size = Vector3.new(1,1,1)
P.formFactor = "Symmetric"
P.TopSurface = "Smooth"
P.BottomSurface = "Smooth"
P.CanCollide = false
P.Locked = true
P.BrickColor = BrickColor.new(23)


local w = Instance.new("Weld")
w.Part1 = h
w.Part0 = P
local C1 = h.CFrame
local C0 = h.CFrame - Vector3.new(0,-1,0) --[[CFrame is Reversed]]--
w.C1 = C1
w.C0 = C0
w.Parent = char
Player.Character.Part.Name="Rasengan"
wait()
Player.Character.Rasengan.archivable = true
Instance.new("SpecialMesh",Player.Character.Rasengan)
Player.Character.Rasengan.Mesh.MeshType="Sphere"
Player.Character.Rasengan.Transparency=0.3
Player.Character.Rasengan.Reflectance=0.3
Player.Character.Rasengan.Mesh.Scale=Vector3.new(0.25,0.25,0.25)
Wait(0.01)
Player.Character.Rasengan.Mesh.Scale=Vector3.new(0.5,0.5,0.5)
Wait(0.01)
Player.Character.Rasengan.Mesh.Scale=Vector3.new(0.725,0.725,0.725)
Player.Character.Humanoid.WalkSpeed="50"
Instance.new("Fire",Player.Character.Rasengan)
Player.Character.Rasengan.Fire.Color=Color3.new(0,0,1)
Player.Character.Rasengan.Fire.SecondaryColor=Color3.new(1,1,1)
Instance.new("Sparkles",Player.Character.Rasengan)
Player.Character.Rasengan.Sparkles.SparkleColor=Color3.new(0,0,1)
Player.Character.Rasengan.Fire.Heat="0"

local connection = Player.Character.Rasengan.Touched:connect(onTouch)



while true do
wait()
if Player.Character.Rasengan ~= nil and Player.Character.Rasengan.archivable == false then
wait(.2)
Player.Character.Rasengan:Remove()
Player.Character.Humanoid.WalkSpeed="16"
wait()
end
end


end)
end)
Report Abuse
Infocus is online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
03 Feb 2013 01:16 AM
bump pls
Report Abuse
Infocus is online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
03 Feb 2013 04:06 AM
bump
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