PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
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)
|
|
|
CFrame.Angles(bin.Parent.Torso.CFrame)
bin.Parent.Torso.CFrame - bin.Parent.Torso.Position |
|
PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
Notunk, ? |
|
PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
NOO HE WENT OFFLINE
oh my god please someone i need help on this |
|
|
bin.Parent.Torso.CFrame.p |
|
PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
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 |
|
PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
NO PLEASE DON'T IGNORE THIS THREAD NO PLEASE |
|
|
Are you trying to rotate the model?
|
|
PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
Well, I'm trying to make it so the model is facing the same direction as my torso. |
|
CasualistJoin Date: 2014-06-26 Post Count: 4443 |
Replace the line that errors with this:
ghost:SetPrimaryPartCFrame(bin.Parent.Torso.CFrame - bin.Parent.Torso.CFrame.p) -- ERROR LINE |
|
PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
@Casu
https://twitter.com/RokinRonan/status/491017522909827073/photo/1
I tried it and this happens.
The model is upside down and at an angle. |
|
|
The line with the error, replace
CFrame.Angles(bin.Parent.Torso.CFrame)
with
bin.Parent.Torso.CFrame - bin.Parent.Torso.Position |
|
PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
SAVE ME SENSEI OR WHOEVER |
|
PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
@notunknown
did the same thing as in the previous screenshot i posted |
|
|
Set the primary part to something not rotated :) |
|
PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
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 :/ |
|
|
Create a part called "MainPart" and use that as the PrimaryPart. |
|
PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
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? |
|
PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
oh. now he's offline
damnit
DASJCASDASD |
|
|
What are you trying to do |
|
PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
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. |
|
PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
anyone |
|
|
What do you set the primary part to? |
|
PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
uploaded screenshot
https://twitter.com/RokinRonan/status/491026556257828864/photo/1
invisible brick in center of model |
|
PhyclopsJoin Date: 2012-09-27 Post Count: 5895 |
this is the part where the thread becomes inactive |
|