Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Bodyposition not going to the position i set it as in the script?

Asked by 3 years ago
Edited 3 years ago

Im am a fairly new to coding and i am try to make a lava trap for a little obby project. I seen the roblox hour of code video using body position to make the part move. I used this on a different trap and it worked. But a few weeks later the body position didnt go to the position i set it on in the script. And now it wont work on this trap. please help me fix this.

I tried using just position and vector3s instead of

Bodyposition.position = PartNameGoesHere.position
local start = game.Worksapce.Start
local End = game.Workspace.End
local turn = game.Workspace.turn
local turn2 = game.Workspace.turn2
local LF = game.Workspace.LavaForFall

while true do
    script.Parent.BodyPosition.position = End.position

end

0
Can you provide your code please ? Cirillix 110 — 3y
0
I put my whole script now Cowboy1555 0 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago

In your line 8,

script.Parent.BodyPosition.Position = End.Position

the p in position needs to be capitalized.

if i still doesn't work, consider trying CFrame, but try the above first

Ad
Log in to vote
0
Answered by 3 years ago

I have figured out a solution to my own problem. I used instance.new() to create a body position in the script instead of putting it in ROBLOX studio my self. from creating it in the script i can now put it into a variable. local movement/(AnyOtherName) = instance.new("Bodyposition") then within a while true do statement i can use the lines

Movement.Position = part.Position

then i can repeat the process with waits and more

My Full Code

local Movement = Instance.new("BodyPosition")
Movement.Parent = script.Parent
local P1 = game.Workspace.P1
local P2 = game.Workspace.P2
local End = game.Workspace.edn
local start = game.Workspace.Start
P1.Transparency = 1
P2.Transparency = 1
start.Transparency = 1
End.Transparency = 1
while true do 
    Movement.Position = End.Position
    wait(0.5)
    Movement.Position = P1.Position
    wait(0.5)
    Movement.Position = P2.Position
    wait(0.5)
    Movement.Position = start.Position
end



Answer this question