|
| 25 Dec 2013 11:04 AM |
I use 2 scripts, a Script to update the fake arm positions and a LocalScript to update a CFrameValue of Mouse.Hit position. The fake arms aren't being CFramed correctly, they go into bizzare positions like 0,-100000,0.
When a character is added, fake arms and some other stuff are parented to the character and are also inserted into a table. When a character is removed, the fake arms are removed from the table. Every frame, the arms in the table are supposed to be updated to the correct positions. THIS DOES NOT USE WELDS.
The LocalScript just constantly updates a CFrameValue's Value to Mouse.Hit.p.
Script:
FakeArms = { ["Right Arms"] = {}; ["Left Arms"] = {} } game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) repeat wait() until char rarm = char["Right Arm"]:Clone() larm = char["Left Arm"]:Clone() mousepointupdater = script.MousePointUpdate:Clone() Instance.new("CFrameValue",mousepointupdater).Name = "MousePoint" mousepointupdater.Parent = char rarm.Anchored = true larm.Anchored = true FakeArms["Right Arms"][player.Name] = rarm FakeArms["Left Arms"][player.Name] = larm rarm.Parent = char larm.Parent = char rarm.Name = "Fake Right" larm.Name = "Fake Left" char["Right Arm"].Transparency = 1 char["Left Arm"].Transparency = 1 end) end)
game.Players.PlayerRemoving:connect(function(player) player.CharacterRemoving:connect(function() FakeArms["Right Arms"][player.Name] = nil FakeArms["Left Arms"][player.Name] = nil end) end)
game:GetService("RunService").Heartbeat:connect(function(step) for i, v in pairs(FakeArms["Right Arms"]) do local char = v.Parent:FindFirstChild("Torso") if char and char:FindFirstChild("Right Shoulder") and char:FindFirstChild("Left Shoulder") and char.Parent:FindFirstChild("MousePointUpdate") then v.CFrame = CFrame.new(Vector3.new(char.CFrame.p+char.CFrame:vectorToWorldSpace(Vector3.new(char["Right Shoulder"].C0.p))), Vector3.new(v.Parent.MousePointUpdate.MousePoint.Value)) end end for i, v in pairs(FakeArms["Left Arms"]) do local char = v.Parent:FindFirstChild("Torso") if char and char:FindFirstChild("Right Shoulder") and char:FindFirstChild("Left Shoulder") and char.Parent:FindFirstChild("MousePointUpdate") then v.CFrame = CFrame.new(Vector3.new(char.CFrame.p+char.CFrame:vectorToWorldSpace(Vector3.new(char["Left Shoulder"].C0.p))), Vector3.new(v.Parent.MousePointUpdate.MousePoint.Value)) end end end)
LocalScript:
repeat wait() until game.Players.LocalPlayer player = game.Players.LocalPlayer mouse = player:GetMouse() mouse.Changed:connect(function(property) if property == mouse.Hit or property == "Hit" then script.MousePoint.Value = mouse.Hit.p end end)
Here is a model to it if you need it:
http://www.roblox.com/Under-Developement-Point-to-mouse-item?id=139794815 |
|
|
| Report Abuse |
|
|
|
| 25 Dec 2013 11:07 AM |
| Btw, the Script is 48 lines long and the LocalScript is 8 lines long. |
|
|
| Report Abuse |
|
|
|
| 25 Dec 2013 08:36 PM |
v.CFrame = CFrame.new(Vector3.new(char.CFrame.p+char.CFrame:vectorToWorldSpace(Vector3.new(char["Left Shoulder"].C0.p))), Vector3.new(v.Parent.MousePointUpdate.MousePoint.Value))
maybe this? Help please |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 25 Dec 2013 10:33 PM |
Apparently the Changed event does not fire when Mouse.Hit changes. I tried
repeat wait() until game.Players.LocalPlayer player = game.Players.LocalPlayer mouse = player:GetMouse() mouse.Move:connect(function() script.MousePoint.Value = mouse.Hit end)
but still no. Help?
Good night for now |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
LordGando
|
  |
| Joined: 05 Jul 2011 |
| Total Posts: 6723 |
|
|
| 26 Dec 2013 08:17 PM |
game.Players.LordGando:MindBlow() end
-LᴏʀᴅGᴀɴᴅᴏ - Cows make milk, I drink milk http://woobox.com/6gs8j6/vote/for/1518073 |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2013 08:42 PM |
@Lord
Error: Attempt to call a nil value
NOW HELP ME PLEAAASSEEEE |
|
|
| Report Abuse |
|
|
| |
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 26 Dec 2013 10:06 PM |
cus only cntkillme knows this stuff and u |
|
|
| Report Abuse |
|
|
|
| 26 Dec 2013 10:14 PM |
wat
http://wiki.roblox.com/index.php/CFrame#Constructors
CFrame.new(Vector3 position, Vector3 point)
ogm mindblown |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
|
| 27 Dec 2013 10:26 AM |
| LordGando - line 2 - EOF expected at 'end' |
|
|
| Report Abuse |
|
|
|
| 27 Dec 2013 10:33 AM |
| ima make a new clean thread with an updated, yet still broken script that fixes the LocalScript problem. I still need it to point to mouse. Just let this thread die and let me post a new one. |
|
|
| Report Abuse |
|
|