jojo8764
|
  |
| Joined: 27 Nov 2012 |
| Total Posts: 1239 |
|
|
| 24 Jul 2017 05:21 PM |
even though there aren't any errors, when the script runs each of the parts stay frozen instead of moving like they are suppose to, i also allowed my project to be edited so it would be easier to help: https://www.roblox.com/games/936972888/please-help
parent = script.Parent
Leg1 = parent.leg1 Leg2 = parent.leg2 Leg3 = parent.leg3 Leg4 = parent.leg4
hinge1 = parent.Parent.PoptartBodyAndHeadSorted.hinge1 hinge2 = parent.Parent.PoptartBodyAndHeadSorted.hinge2 hinge3 = parent.Parent.PoptartBodyAndHeadSorted.hinge3 hinge4 = parent.Parent.PoptartBodyAndHeadSorted.hinge4
--function --------sleep() --wait(0.05) --end
function BreakAllJoints() Leg1:BreakJoints() Leg2:BreakJoints() Leg3:BreakJoints() Leg4:BreakJoints() end -- when the script ran it said i need to etiher break or kill script, i breaked, and when i did there was a line poiting to where im commenting right now.
local TIME = 0.05 --Change this to the amount of seconds you want to run the loop
local startingTime = tick()
while true do print("test") ----------sleep() BreakAllJoints() while tick() - startingTime < TIME do Leg1.CFrame = CFrame.new(hinge1.CFrame.X + 2.5,hinge1.CFrame.Y,hinge1.CFrame.Z - 1) Leg2.CFrame = CFrame.new(hinge2.CFrame.X - 2.5,hinge2.CFrame.Y,hinge2.CFrame.Z - 1) Leg3.CFrame = CFrame.new(hinge3.CFrame.X - 2.5,hinge3.CFrame.Y,hinge3.CFrame.Z - 1) Leg4.CFrame = CFrame.new(hinge4.CFrame.X + 2.5,hinge4.CFrame.Y,hinge4.CFrame.Z - 1) wait() end ----------sleep() BreakAllJoints() while tick() - startingTime < TIME do Leg1.CFrame = CFrame.new(hinge1.CFrame.X + 2.5,hinge1.CFrame.Y - 1,hinge1.CFrame.Z) Leg2.CFrame = CFrame.new(hinge2.CFrame.X - 2.5,hinge2.CFrame.Y - 1,hinge2.CFrame.Z) Leg3.CFrame = CFrame.new(hinge3.CFrame.X - 2.5,hinge3.CFrame.Y - 1,hinge3.CFrame.Z) Leg4.CFrame = CFrame.new(hinge4.CFrame.X + 2.5,hinge4.CFrame.Y - 1,hinge4.CFrame.Z) wait() end ----------sleep() BreakAllJoints() while tick() - startingTime < TIME do Leg1.CFrame = CFrame.new(hinge1.CFrame.X + 2.5,hinge1.CFrame.Y,hinge1.CFrame.Z + 1) Leg2.CFrame = CFrame.new(hinge2.CFrame.X - 2.5,hinge2.CFrame.Y,hinge2.CFrame.Z + 1) Leg3.CFrame = CFrame.new(hinge3.CFrame.X - 2.5,hinge3.CFrame.Y,hinge3.CFrame.Z + 1) Leg4.CFrame = CFrame.new(hinge4.CFrame.X + 2.5,hinge4.CFrame.Y,hinge4.CFrame.Z + 1) wait() end ----------sleep() BreakAllJoints() while tick() - startingTime < TIME do Leg1.CFrame = CFrame.new(hinge1.CFrame.X + 2.5,hinge1.CFrame.Y,hinge1.CFrame.Z + 1) Leg2.CFrame = CFrame.new(hinge2.CFrame.X - 2.5,hinge2.CFrame.Y,hinge2.CFrame.Z + 1) Leg3.CFrame = CFrame.new(hinge3.CFrame.X - 2.5,hinge3.CFrame.Y,hinge3.CFrame.Z + 1) Leg4.CFrame = CFrame.new(hinge4.CFrame.X + 2.5,hinge4.CFrame.Y,hinge4.CFrame.Z + 1) wait() end ----------sleep() BreakAllJoints() while tick() - startingTime < TIME do Leg1.CFrame = CFrame.new(hinge1.CFrame.X + 2.5,hinge1.CFrame.Y + 1,hinge1.CFrame.Z) Leg2.CFrame = CFrame.new(hinge2.CFrame.X - 2.5,hinge2.CFrame.Y + 1,hinge2.CFrame.Z) Leg3.CFrame = CFrame.new(hinge3.CFrame.X - 2.5,hinge3.CFrame.Y + 1,hinge3.CFrame.Z) Leg4.CFrame = CFrame.new(hinge4.CFrame.X + 2.5,hinge4.CFrame.Y + 1,hinge4.CFrame.Z) wait() end --------sleep() BreakAllJoints() while tick() - startingTime < TIME do Leg1.CFrame = CFrame.new(hinge1.CFrame.X + 2.5,hinge1.CFrame.Y,hinge1.CFrame.Z - 1) Leg2.CFrame = CFrame.new(hinge2.CFrame.X - 2.5,hinge2.CFrame.Y,hinge2.CFrame.Z - 1) Leg3.CFrame = CFrame.new(hinge3.CFrame.X - 2.5,hinge3.CFrame.Y,hinge3.CFrame.Z - 1) Leg4.CFrame = CFrame.new(hinge4.CFrame.X + 2.5,hinge4.CFrame.Y,hinge4.CFrame.Z - 1) end wait() print("test 2") end
|
|
|
| Report Abuse |
|
|
jojo8764
|
  |
| Joined: 27 Nov 2012 |
| Total Posts: 1239 |
|
| |
|
jojo8764
|
  |
| Joined: 27 Nov 2012 |
| Total Posts: 1239 |
|
| |
|
jojo8764
|
  |
| Joined: 27 Nov 2012 |
| Total Posts: 1239 |
|
| |
|
|
| 24 Jul 2017 06:54 PM |
| what is the script supposed to do? |
|
|
| Report Abuse |
|
|
jojo8764
|
  |
| Joined: 27 Nov 2012 |
| Total Posts: 1239 |
|
|
| 24 Jul 2017 07:37 PM |
its suppose to move each of the 4 parts in a loop constantly
|
|
|
| Report Abuse |
|
|
BaiYuni
|
  |
| Joined: 09 Oct 2009 |
| Total Posts: 2861 |
|
|
| 24 Jul 2017 07:58 PM |
I honestly don't know what this script is doing, but there is a need for for loops and a wait()
parent = script.Parent
Leg1 = parent.leg1 Leg2 = parent.leg2 Leg3 = parent.leg3 Leg4 = parent.leg4
local legs = {Leg1, Leg2, Leg3, Leg4 } hinge1 = parent.Parent.PoptartBodyAndHeadSorted.hinge1 hinge2 = parent.Parent.PoptartBodyAndHeadSorted.hinge2 hinge3 = parent.Parent.PoptartBodyAndHeadSorted.hinge3 hinge4 = parent.Parent.PoptartBodyAndHeadSorted.hinge4
local hinges = {hinge1, hinge2, hinge3, hinge4} --function --------sleep() --wait(0.05) --end
function BreakAllJoints() for _, v in pairs(legs) do v:BreakJoints() end end -- when the script ran it said i need to etiher break or kill script, i breaked, and when i did there was a line poiting to where im commenting right now.
local TIME = 1 --Change this to the amount of seconds you want to run the loop
while true do local startingTime = tick() print("test") ----------ONE BreakAllJoints() --print(tick()-startingTime < TIME) while tick() - startingTime < TIME do for _, v in pairs(legs) do if _ == 1 or _ == 4 then v.CFrame = CFrame.new(hinges[_].CFrame.X + 2.5, hinges[_].CFrame.Y, hinges[_].CFrame.Z - 1) print("1 or 4") --print("Changing hinge") else v.CFrame = CFrame.new(hinges[_].CFrame.X - 2.5, hinges[_].CFrame.Y, hinges[_].CFrame.Z - 1) print("2 or 3") end end wait() end ----------TWO BreakAllJoints() while tick() - startingTime < TIME do for _, v in pairs(legs) do if _ == 1 or _ == 4 then v.CFrame = CFrame.new(hinges[_].CFrame.X + 2.5, hinges[_].CFrame.Y - 1, hinges[_].CFrame.Z) else v.CFrame = CFrame.new(hinges[_].CFrame.X - 2.5, hinges[_].CFrame.Y - 1, hinges[_].CFrame.Z) end end wait() end ----------THREE BreakAllJoints() while tick() - startingTime < TIME do for _, v in pairs(legs) do if _ == 1 or _ == 4 then v.CFrame = CFrame.new(hinges[_].CFrame.X + 2.5, hinges[_].CFrame.Y, hinges[_].CFrame.Z + 1) else v.CFrame = CFrame.new(hinges[_].CFrame.X - 2.5, hinges[_].CFrame.Y, hinges[_].CFrame.Z + 1) end end wait() end ----------FOUR BreakAllJoints() while tick() - startingTime < TIME do for _, v in pairs(legs) do if _ == 1 or _ == 4 then v.CFrame = CFrame.new(hinges[_].CFrame.X + 2.5, hinges[_].CFrame.Y, hinges[_].CFrame.Z + 1) else v.CFrame = CFrame.new(hinges[_].CFrame.X - 2.5, hinges[_].CFrame.Y, hinges[_].CFrame.Z + 1) end end wait() end BreakAllJoints() while tick() - startingTime < TIME do for _, v in pairs(legs) do if _ == 1 or _ == 4 then v.CFrame = CFrame.new(hinges[_].CFrame.X + 2.5, hinges[_].CFrame.Y + 1, hinges[_].CFrame.Z) else v.CFrame = CFrame.new(hinges[_].CFrame.X - 2.5, hinges[_].CFrame.Y + 1, hinges[_].CFrame.Z) end end wait() end --------sleep() BreakAllJoints() while tick() - startingTime < TIME do for _, v in pairs(legs) do if _ == 1 or _ == 4 then v.CFrame = CFrame.new(hinges[_].CFrame.X + 2.5, hinges[_].CFrame.Y, hinges[_].CFrame.Z - 1) else v.CFrame = CFrame.new(hinges[_].CFrame.X - 2.5, hinges[_].CFrame.Y, hinges[_].CFrame.Z - 1) end end wait() print("test 2") end wait() end
When I tried it, it didn't do anything... I probably did something wrong. |
|
|
| Report Abuse |
|
|
jojo8764
|
  |
| Joined: 27 Nov 2012 |
| Total Posts: 1239 |
|
|
| 24 Jul 2017 09:43 PM |
uuuuuuugghh why is it everything i try doesn't work!!!!
|
|
|
| Report Abuse |
|
|
jojo8764
|
  |
| Joined: 27 Nov 2012 |
| Total Posts: 1239 |
|
|
| 24 Jul 2017 09:46 PM |
i only have 3 robux, so the first person to fix the script i will give 3 robux too
|
|
|
| Report Abuse |
|
|
rower86
|
  |
| Joined: 06 Dec 2013 |
| Total Posts: 85 |
|
|
| 24 Jul 2017 09:52 PM |
if u want tp move something in a loop forever just do the "while true do" loop and inside it theres a way to move objects example:
while true do script.parent.position = script.parent.postition + Vector3.new(0,0,0)-- put the coordinates of how much u want them to move each time end |
|
|
| Report Abuse |
|
|
rower86
|
  |
| Joined: 06 Dec 2013 |
| Total Posts: 85 |
|
|
| 24 Jul 2017 09:53 PM |
i wrote it wrong its supposed to be
while true do script.parent.position = script.parent.postition + Vector3.new(0,0,0)-- put the coordinates of how much u want them to move each time wait(0.3) end |
|
|
| Report Abuse |
|
|
BaiYuni
|
  |
| Joined: 09 Oct 2009 |
| Total Posts: 2861 |
|
|
| 24 Jul 2017 10:57 PM |
Still written wrong.
It's case sensitive
'Parent'
'Position' |
|
|
| Report Abuse |
|
|
jojo8764
|
  |
| Joined: 27 Nov 2012 |
| Total Posts: 1239 |
|
|
| 25 Jul 2017 04:08 PM |
srsly its been an entire day and no one has given me a solution
|
|
|
| Report Abuse |
|
|
jojo8764
|
  |
| Joined: 27 Nov 2012 |
| Total Posts: 1239 |
|
|
| 25 Jul 2017 04:09 PM |
i thought allowing people to edit my game would help but i guess apparently not
|
|
|
| Report Abuse |
|
|
GGGGG14
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25344 |
|
|
| 25 Jul 2017 04:09 PM |
| Sorry jojo idk how to fix it |
|
|
| Report Abuse |
|
|
jojo8764
|
  |
| Joined: 27 Nov 2012 |
| Total Posts: 1239 |
|
| |
|
nullfeels
|
  |
| Joined: 31 Mar 2017 |
| Total Posts: 1215 |
|
|
| 25 Jul 2017 04:15 PM |
| The word "hinges" is really throwing me off. Are these actual HingeConstraints? If so do you have "PGS Physics Solver" enabled? |
|
|
| Report Abuse |
|
|
nullfeels
|
  |
| Joined: 31 Mar 2017 |
| Total Posts: 1215 |
|
|
| 25 Jul 2017 04:19 PM |
| Sorry, I didn't really read the code, but I just skimmed it and I'm guessing they're not. |
|
|
| Report Abuse |
|
|
jojo8764
|
  |
| Joined: 27 Nov 2012 |
| Total Posts: 1239 |
|
|
| 25 Jul 2017 04:20 PM |
@nullfeels. well they were, its really complicated, this is unrelated to task at hand, but later on after i finish making this script work, when each of the 4 parts make contact to the ground, the i'm trying to fix will be disabled with another script which will enable separate script to which will switch the "hinge" parts left and right surfaces to hinge. but thats not important, for now you dont need to worry about the name relating anything else, its just what its called for now.
|
|
|
| Report Abuse |
|
|
nullfeels
|
  |
| Joined: 31 Mar 2017 |
| Total Posts: 1215 |
|
|
| 25 Jul 2017 04:45 PM |
| Okay so I kinda looked through the code and there is a few things making it not work. The problem is that in order for me to fix it I've to know exactly what this thing is and what it's meant to do. I've no clue, honestly. |
|
|
| Report Abuse |
|
|
nullfeels
|
  |
| Joined: 31 Mar 2017 |
| Total Posts: 1215 |
|
|
| 25 Jul 2017 05:04 PM |
| So if you could explain that to me in detail, I'll try, but I don't have much time. |
|
|
| Report Abuse |
|
|
jojo8764
|
  |
| Joined: 27 Nov 2012 |
| Total Posts: 1239 |
|
|
| 25 Jul 2017 05:12 PM |
| each part is suppose to be moved up, right, down, left, and in a loops like that relative to the hinge parts position. but there are loops #################### you see i was originally going to attach weld's to the parts as they move so they can follow the hinge. but that cause a lot of welding issues. so now my only way of getting the parts to have a moving animation while following the hinge parts without lagging behind is to have a loop for at least 0.05 seconds of being in the same cframe position relative to the hinge parts position, until the 0.05 seconds end and it moves to its next Cframe position relative to the hinge parts position |
|
|
| Report Abuse |
|
|
nullfeels
|
  |
| Joined: 31 Mar 2017 |
| Total Posts: 1215 |
|
|
| 25 Jul 2017 05:17 PM |
Gotcha. You're way over complicating this. I can try to create what I think you're wanting as a model and upload it for you to check out if you want. I be scraping 80-90% of your code though.
Let me know. |
|
|
| Report Abuse |
|
|
jojo8764
|
  |
| Joined: 27 Nov 2012 |
| Total Posts: 1239 |
|
|
| 25 Jul 2017 05:18 PM |
thx very much i appreciate you helping me
|
|
|
| Report Abuse |
|
|
nullfeels
|
  |
| Joined: 31 Mar 2017 |
| Total Posts: 1215 |
|
|
| 25 Jul 2017 06:11 PM |
I realize this may not be what you wanted, but I've completely ran out of time. Sorry.
I've created this in a rush, but hopefully it will help you out.
https://www.roblox.com/catalog/939186815/redirect |
|
|
| Report Abuse |
|
|