|
local p = Instance.new("Part")
p.FormFactor = "Custom"
p.Shape = "Cylinder"
p.Size = Vector3.new(35.2, 25.2, 28.2)
p.BrickColor = BrickColor.new("Bright yellow")
p.Material = "SmoothPlastic"
p.BackSurface = "SmoothNoOutlines"
p.FrontSurface = "SmoothNoOutlines"
p.BottomSurface = "SmoothNoOutlines"
p.LeftSurface = "SmoothNoOutlines"
p.RightSurface = "SmoothNoOutlines"
p.TopSurface = "SmoothNoOutlines"
p.Anchored = false
p.CanCollide = false
p.Transparency = 0.2
local w1 = Instance.new("Weld")
w1.Parent = plr.Character:FindFirstChild("Torso")
w1.Part0 = w1.Parent
w1.Part1 = p
w1.C1 = CFrame.new(0, -20, 0)
w1.Part1.Parent = game.Workspace
for some reason when I cast this the player is teleported under the map, when the cframe is 0 the players gets weighed down by it. |
|
|
oni0nJoin Date: 2012-11-04 Post Count: 2975 |
"local w1 = Instance.new("Weld")
w1.Parent = plr.Character:FindFirstChild("Torso")
w1.Part0 = w1.Parent
w1.Part1 = p
w1.C1 = CFrame.new(0, -20, 0)
w1.Part1.Parent = game.Workspace"
I don't understand, why would you parent a property to something? This is really easy to fix and I recommend you start off with something easier. If you want to continue, here's a fixed version of your weld portion, as the part instance is already working and functional:
local w1 = Instance.new("Weld", p) --[[ you can easily set the parent of the weld like this]]--
w1.Part0 = plr.Character:findFirstChild("Torso") --[[ assuming you've already declared "plr"]]--
w1.Part1 = p
w1.C1 = CFrame.new(0, 0, 0) --[[ why would you want to offset the weld's C1?? C1 is used for pivoting at a specific point..]]--
w1.C0 = CFrame.new(0, -20, 0) --[[ what you REALLY want to do is set the C0 of the part to -20, offsetting it above the character's torso by -20 studs. ]]--
#code cout << "Truth shall sit upon the lips of a dying man" << endl; //Matthew Arnold |
|
Hedr0nJoin Date: 2016-01-05 Post Count: 1524 |
Onion I think your sig is wildly stupid |
|
oni0nJoin Date: 2012-11-04 Post Count: 2975 |
Remove the block comments once you've fully read and understood them. I'm still dumbfounded by this single line.. "w1.Part1.Parent = game.Workspace"
I mean what led you to thinking that you could make an instance's property's parent workspace? Mind anything at all?? What were you even trying to accomplish?!
#code cout << "Truth shall sit upon the lips of a dying man" << endl; //Matthew Arnold |
|
oni0nJoin Date: 2012-11-04 Post Count: 2975 |
Remove the block comments once you've fully read and understood them. I'm still dumbfounded by this single line.. "w1.Part1.Parent = game.Workspace"
I mean what led you to thinking that you could make an instance's property's parent workspace? Mind anything at all?? What were you even trying to accomplish?!
#code cout << "Truth shall sit upon the lips of a dying man" << endl; //Matthew Arnold
#code cout << "Truth shall sit upon the lips of a dying man" << endl; //Matthew Arnold |
|
oni0nJoin Date: 2012-11-04 Post Count: 2975 |
Damnit, lagged ;(
#code cout << "Truth shall sit upon the lips of a dying man" << endl; //Matthew Arnold |
|
|
local w1 = Instance.new("Weld", p)
w1.Part0 = plr.Character:findFirstChild("HumanoidRootPart")
w1.Part1 = p
w1.C1 = CFrame.new(0, 0, 0)
w1.C0 = CFrame.new(0, -5, 0)
This still Teleports the Player, and the players legs still go under the baseplate. |
|
oni0nJoin Date: 2012-11-04 Post Count: 2975 |
local p = Instance.new("Part", plr.Character)
p.Anchored = false
p.Cancollide = false
p.Material = "SmoothPlastic"
p.BackSurface = "SmoothNoOutlines"
p.FrontSurface = "SmoothNoOutlines"
p.BottomSurface = "SmoothNoOutlines"
p.LeftSurface = "SmoothNoOutlines"
p.RightSurface = "SmoothNoOutlines"
p.TopSurface = "SmoothNoOutlines"
p.FormFactor = "Custom"
p.Shape = "Cylinder"
p.BrickColor = BrickColor.new("Bright yellow")
p.Transparency = 0.2
Weld = Instance.new("Weld", p)
Weld.Part0 = p
Weld.Part1 = plr.Character:findFirstChild("HumanoidRootPart")
Weld.C0 = CFrame.new(0, -5, 0)
#code cout << "Truth shall sit upon the lips of a dying man" << endl; //Matthew Arnold |
|
|
http://postimg.org/image/8fezsi8jb/ |
|
oni0nJoin Date: 2012-11-04 Post Count: 2975 |
what are you even trying to do??
#code cout << "Truth shall sit upon the lips of a dying man" << endl; //Matthew Arnold |
|
|
I'm just trying to weld this big Cylinder to the players torso to give of an effect that they are surrounded by lightning but I want it to move with the player.
I know I could just constantly set its Position to the players torso but I thought welding would be more convenient. |
|
oni0nJoin Date: 2012-11-04 Post Count: 2975 |
that makes no sense
and just offset & resize the part in the code i gave you, nerd
i'm not going to keep spoon-feeding you, y'know..
#code cout << "Proof by analogy is fraud" << endl; //Bjarne Stroustrup |
|
|
It makes complete sense..
Basically, this part is created when the player presses the key "Z", the player then says "Lightning Blah-Blah" and I want the part to be welded to the players torso which would allow them to move well the part is around them.
Don't be rude, I asked for help, you chose to help and it happened to not fix the problem, so I asked for more, assuming you'd understand the direction I was going in.
Thanks. |
|
oni0nJoin Date: 2012-11-04 Post Count: 2975 |
"it happened to not fix the problem"
you're implying that i'm supposed to fix your problem for you? i simply volunteered to help you, i can help you as much as i want
even more, is that i gave you enough information to fix it yourself.
i literally spoonfed you the entire working code, all you have to do now is offset the part and resize it..
#code cout << "Proof by analogy is fraud" << endl; //Bjarne Stroustrup |
|
|
...
It did not fix it- The error left behind is that regardless of where the offset is put, the player's legs will fall under the map, this is the error I started off with.
I never said you had to fix my problem, I said the information you gave to fix it, did not, then got rude when I replied that did not fix it. |
|
iondriverJoin Date: 2012-11-18 Post Count: 757 |
This is not so much a script problem as a physics problem. Try enabling the new physics engine and custom part properties, and then adjusting the parts density to as close to 0 as you can get it. (I don't remember the cap off the top of my head) |
|
|
I did attempt that, I set everything within CustomProperties to 0 but the player was still put through the ground. |
|
oni0nJoin Date: 2012-11-04 Post Count: 2975 |
Then don't you think something else might be wrong???
#code cout << "Proof by analogy is fraud" << endl; //Bjarne Stroustrup |
|
|