|
| 09 May 2016 12:03 PM |
'Eyyy... I am creating a "Rasenshuriken" tool, and I need help with CFrame.Angles() and CFrame.fromEulerAnglexXYZ().
So, here is the Rasenshuriken script:
--ChaotikDawg's Rasenshuriken script v1.2
local Player = script.Parent.Parent.Parent local Tool = script.Parent local Character = Player.Character local Mouse = Player:GetMouse() chat=game:GetService("Chat") sound = Instance.new("Sound") sound.Parent = game.Workspace sound.SoundId = "http://www.roblox.com/asset/?id=189133009" sound.Volume = 1.5
--Animation = script:WaitForChild("Animation")
LeftShoulder=Player.Character.Torso["Left Shoulder"] RightShoulder=Player.Character.Torso["Right Shoulder"] value1 = LeftShoulder.C0 value2 = RightShoulder.C0
enabled = script.deb local function onActivate() wait(.001) if enabled.Value == true then if not enabled.Value then return end sound:Play() wait(.01) enabled.Value = false chat:Chat(Player.Character.Head,"Sage Art: Rasenshuriken!",Enum.ChatColor.Red)
RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0.5, 0, 3.5) LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(-0.5, 0, .5) Character.Humanoid.WalkSpeed = Character.Humanoid.WalkSpeed + 30 ff = Instance.new("Part") ff.Parent = game.Workspace ff.TopSurface = "Smooth" ff.BottomSurface = "Smooth" ff.BrickColor = BrickColor.new("Toothpaste") ff.CFrame = Player.Character:FindFirstChild("Right Arm").CFrame*CFrame.new(0,3.35,0) ff.Transparency = .6 ff.Shape = "Ball" ff.Size = Vector3.new(2.5, 2.5, 2.5) ff.CanCollide = false wf = Instance.new("Weld") wf.Parent = Player.Character:FindFirstChild("Right Arm") wf.Part0 = Player.Character:FindFirstChild("Right Arm") wf.Part1 = ff wf.C1 = CFrame.new(0, 3.35, 0) s = game.Lighting.Rasenshuriken:clone() s.Parent = ff s.CFrame = Player.Character:FindFirstChild("Right Arm").CFrame*CFrame.new(0,.075,0) s.Transparency = .6 s.CanCollide = false ws = Instance.new("Weld") ws.Parent = ff ws.Part0 = ff ws.Part1 = s ws.C1 = CFrame.new(0, 2.75, 0) end wait(6) enabled.Value = true end
local function onDeactivate() wait(7.5) sound:Stop() Character.Humanoid.WalkSpeed = Character.Humanoid.WalkSpeed - 30 s:remove() ff:remove() RightShoulder.C0 = value1 LeftShoulder.C0 = value2 end
Tool.Activated:connect(onActivate) Tool.Deactivated:connect(onDeactivate)
---------------------------------------------------------------------- Now, here is the Rasenshuriken ROTATION script:
spinning = script.Parent
while true do spinning.CFrame = spinning.CFrame*CFrame.fromEulerAnglesXYZ(0,.1,0) wait(0.06) end
----------------------------------------------------------------------
The problem is that when I activate the tool, my character starts flinging around, and I need a fix. Please help!
Thank you for taking your time to read this,
-ChaotikDawg |
|
|
| Report Abuse |
|
|
| |
|
Romul
|
  |
| Joined: 08 Mar 2009 |
| Total Posts: 597 |
|
|
| 09 May 2016 12:13 PM |
Hopefully the next person can help you better, but I can say that the flinging around is due to the RasenShuriken being welded to the players arm. While you are pathing it all right, you are forced to bring the character in with you due to the weld.
I'm guessing you are wanting the player to hold it above their head/out extended and then have a function to throw when they want? Or are you keeping it welded to their hand and them having to hit on contact like with a typical Rasengan?
A solution I'd probably do if it was ME creating RasenShuriken, is work on it to be a visual effect through a ParticleEmitter.
Again hopefully someone else can solve this well, as I'm curios for my own game. Thanks and good luck! |
|
|
| Report Abuse |
|
|
|
| 09 May 2016 12:16 PM |
My goal was for the character to have the Rasenshuriken in their hand at all times, as if it were a Rasengan type attack. While it still spins. I thought that the Arm Weld was the problem, but I couldn't think of any solutions for the problem. |
|
|
| Report Abuse |
|
|
Romul
|
  |
| Joined: 08 Mar 2009 |
| Total Posts: 597 |
|
|
| 09 May 2016 12:19 PM |
| Yea see in that manner I can't figure a good way other than using Particles or some visual method. To do what you are wanting, it has to be welded to the arm to move with the player. Overall it sounds like a cool effect, just can't figure how to do it without welding then grabbing the character in the spin. |
|
|
| Report Abuse |
|
|
|
| 09 May 2016 12:22 PM |
| You should add me. We can develop places together. |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 09 May 2016 12:23 PM |
CFrame.Angles() and CFrame.fromEulerAnglexXYZ() are the same thing...
|
|
|
| Report Abuse |
|
|
|
| 09 May 2016 12:24 PM |
| I know that. I was just establishing that I need help in that general area. Don't post unless you have a solution. |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 09 May 2016 12:25 PM |
Well if you're going to be so rude I won't help I was looking over the script now i'll delete it and move on.
|
|
|
| Report Abuse |
|
|
Romul
|
  |
| Joined: 08 Mar 2009 |
| Total Posts: 597 |
|
|
| 09 May 2016 12:29 PM |
| Dev the problem isn't with the script itself. It's with the welded rotation. He is trying to rotate a part he welded to the characters arm, so it is rotating his whole body. Save you some reading at least. :P |
|
|
| Report Abuse |
|
|
|
| 09 May 2016 12:31 PM |
| Dev, you should totally help me :3 |
|
|
| Report Abuse |
|
|
Romul
|
  |
| Joined: 08 Mar 2009 |
| Total Posts: 597 |
|
|
| 09 May 2016 12:34 PM |
http://wiki.roblox.com/index.php?title=Weld#Rotating_the_CFrame
Go to "Rotating the CFrame" and see if that helps. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 10 May 2016 06:23 PM |
~~ BUMP ~~
This is my new script, and I really need help..
--ChaotikDawg's Fireball script v1.2
local Player = game.Players.LocalPlayer local Tool = script.Parent local Character = Player.Character local Mouse = Player:GetMouse() chat=game:GetService("Chat") sound = Instance.new("Sound") sound.Parent = game.Workspace sound.SoundId = "http://www.roblox.com/asset/?id=189133009" sound.Volume = 1.5 --Animation = script:WaitForChild("Animation")
LeftShoulder=Player.Character.Torso["Left Shoulder"] RightShoulder=Player.Character.Torso["Right Shoulder"] value1 = LeftShoulder.C0 value2 = RightShoulder.C0
enabled = script.deb local function onActivate() wait(.001) if enabled.Value == true then if not enabled.Value then return end sound:Play() wait(.01) enabled.Value = false chat:Chat(Player.Character.Head,"Sage Art: Rasenshuriken!",Enum.ChatColor.Red)
RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(0.5, 0, 3.5) LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(-0.5, 0, .5) Character.Humanoid.WalkSpeed = Character.Humanoid.WalkSpeed + 30 s = Instance.new("Part") s.Size = Vector3.new(40,20,40) s.Reflectance = 0.75 s.BrickColor = BrickColor.new("Cyan") s.Material = "Sand" s.Anchored = false s.Parent = Player.Character:FindFirstChild("Right Arm") s.CFrame = Player.Character:FindFirstChild("Right Arm").CFrame*CFrame.new(0,3.35,0) s.Transparency = .6 s.CanCollide = false shurikenMesh = Instance.new("SpecialMesh") shurikenMesh.Parent = s shurikenMesh.MeshId = "http://www.roblox.com/asset/?id=11376946" shurikenMesh.Scale = Vector3.new(30,30,30) ws = Instance.new("ManualWeld",Player.Character:FindFirstChild("Right Arm")) ws.Part0 = Player.Character:FindFirstChild("Right Arm") ws.Part1 = s ws.C1 = CFrame.new(0, 3.35, 0) ff = Instance.new("Part") ff.Parent = Player.Character:FindFirstChild("Right Arm") ff.TopSurface = "Smooth" ff.BottomSurface = "Smooth" ff.BrickColor = BrickColor.new("Toothpaste") ff.CFrame = Player.Character:FindFirstChild("Right Arm").CFrame*CFrame.new(0,3.35,0) ff.Transparency = .6 ff.Shape = "Ball" ff.Size = Vector3.new(2.5, 2.5, 2.5) ff.CanCollide = false wf = Instance.new("ManualWeld",Player.Character:FindFirstChild("Right Arm")) wf.Part0 = Player.Character:FindFirstChild("Right Arm") wf.Part1 = ff wf.C1 = CFrame.new(0, 3.35, 0) local i = 1 for i = 1,50 do print(i) ws:remove() s.CFrame = s.CFrame*CFrame.Angles(0,.2,0) ws = Instance.new("ManualWeld",Player.Character:FindFirstChild("Right Arm")) ws.Part0 = Player.Character:FindFirstChild("Right Arm") ws.Part1 = s ws.C1 = CFrame.new(0, 3.35, 0) wait(.1) i = i + 1 end end wait(4) enabled.Value = true end
local function onDeactivate() wait(7.5) sound:Stop() Character.Humanoid.WalkSpeed = Character.Humanoid.WalkSpeed - 30 s:remove() ff:remove() RightShoulder.C0 = value1 LeftShoulder.C0 = value2 end
Tool.Activated:connect(onActivate) Tool.Deactivated:connect(onDeactivate) |
|
|
| Report Abuse |
|
|
|
| 10 May 2016 07:17 PM |
| bumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbumpbump |
|
|
| Report Abuse |
|
|
Tynezz
|
  |
| Joined: 28 Apr 2014 |
| Total Posts: 4945 |
|
|
| 10 May 2016 07:21 PM |
Uh
while wait(0.06) do ws.C1=ws.C1*CFrame.Angles(0,0,1) --experiment with x,y,z end |
|
|
| Report Abuse |
|
|
|
| 12 May 2016 03:15 PM |
| My character still flings.. Would I put that in the same script as the weld, or the script that the Shuriken Model is in? |
|
|
| Report Abuse |
|
|
|
| 12 May 2016 03:43 PM |
| Nevermind, I guess I tampered too much with your given advice, Tynezz. Thank you so much! It works now! |
|
|
| Report Abuse |
|
|