Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 20 Jul 2014 07:04 PM |
local bin = script.Parent local shelter = game.ReplicatedStorage.Shelter local amt = bin:FindFirstChild("Amount")
local ghost = nil
function makeGhost() ghost = shelter:clone() ghost.Parent = game.Workspace.CurrentCamera ghost:MakeJoints() ghost.PrimaryPart=ghost.Primary local g = ghost:GetChildren() ghost:SetPrimaryPartCFrame(CFrame.Angles(bin.Parent.Torso.CFrame)) -- ERROR LINE for i = 1,#g do if g[i]:IsA("Part") then g[i].Transparency = 0.7 g[i].BrickColor = BrickColor.new("Bright green") g[i].CanCollide = false end end end
function onButton1Down(mouse) ghost:Destroy() local model = shelter:clone() model.Parent = game.Workspace model:MakeJoints() model:MoveTo(mouse.Hit.p) local g = model:GetChildren() for i = 1, #g do if g[i]:IsA("Part") then g[i].Anchored = true end end amt.Value = amt.Value - 1 if amt.Value == 0 then bin:Destroy() if ghost then ghost:Destroy() ghost = nil end end makeGhost() end
bin.Equipped:connect(function(mouse) makeGhost() mouse.Move:connect(function() if ghost then mouse.TargetFilter = ghost ghost:MoveTo(mouse.Hit.p) end end) mouse.Icon = "rbxasset://textures\\GunCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) end) bin.Unequipped:connect(function() if ghost then ghost:Destroy() end end)
|
|
|
| Report Abuse |
|
|
|
| 20 Jul 2014 07:11 PM |
CFrame.Angles(bin.Parent.Torso.CFrame)
bin.Parent.Torso.CFrame - bin.Parent.Torso.Position |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
| |
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 20 Jul 2014 07:19 PM |
NOO HE WENT OFFLINE oh my god please someone i need help on this |
|
|
| Report Abuse |
|
|
| |
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 20 Jul 2014 07:23 PM |
SAVE ME SENSEI YOU ARE MY ONLY HOPE 01:22:11.555 - Players.Player1.Backpack.Geo.Spawner:13: bad argument #3 to 'Angles' (number expected, got no value)
ONCE AGAIN |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 20 Jul 2014 07:26 PM |
| NO PLEASE DON'T IGNORE THIS THREAD NO PLEASE |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2014 07:27 PM |
Are you trying to rotate the model?
|
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 20 Jul 2014 07:27 PM |
| Well, I'm trying to make it so the model is facing the same direction as my torso. |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 20 Jul 2014 07:27 PM |
Replace the line that errors with this:
ghost:SetPrimaryPartCFrame(bin.Parent.Torso.CFrame - bin.Parent.Torso.CFrame.p) -- ERROR LINE |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 20 Jul 2014 07:32 PM |
@Casu
https://twitter.com/RokinRonan/status/491017522909827073/photo/1
I tried it and this happens. The model is upside down and at an angle. |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2014 07:36 PM |
The line with the error, replace
CFrame.Angles(bin.Parent.Torso.CFrame)
with
bin.Parent.Torso.CFrame - bin.Parent.Torso.Position |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
| |
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 20 Jul 2014 07:37 PM |
@notunknown did the same thing as in the previous screenshot i posted |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2014 07:38 PM |
| Set the primary part to something not rotated :) |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 20 Jul 2014 07:41 PM |
Ah, no longer tilted, you are genius omg but it is still not facing my torso position instead, it changes the rotation every time i place a new shelter :/ |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2014 07:43 PM |
| Create a part called "MainPart" and use that as the PrimaryPart. |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 20 Jul 2014 07:46 PM |
Just did it, but what difference should that make? It made no difference. Would you like me to link you to a place where you can see what it does for yourself? |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 20 Jul 2014 07:51 PM |
oh. now he's offline damnit DASJCASDASD |
|
|
| Report Abuse |
|
|
| |
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 20 Jul 2014 07:59 PM |
Basically, I want it like this: http://youtu.be/NvQJvYAm92Y?t=2m22s
You see how the model is always in front of his character when he's placing it? Like that. |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
| |
|
|
| 20 Jul 2014 08:04 PM |
| What do you set the primary part to? |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 20 Jul 2014 08:07 PM |
uploaded screenshot https://twitter.com/RokinRonan/status/491026556257828864/photo/1
invisible brick in center of model |
|
|
| Report Abuse |
|
|
Phyclops
|
  |
| Joined: 27 Sep 2012 |
| Total Posts: 5895 |
|
|
| 20 Jul 2014 08:12 PM |
| this is the part where the thread becomes inactive |
|
|
| Report Abuse |
|
|