generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Stuck on a Position Script

Previous Thread :: Next Thread 
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
22 Dec 2011 05:51 PM
Here is the script I am stuck on:
function start()
local Torso = script.Parent.Parent.Character.Torso.Position
if Torso.Y > 10 then
local health = script.Parent.Parent.Character.Humanoid.Health
local warning = script.Parent.AltitudeSickness.Frame.Visible
health = health - 10
warning = true
wait(3)
if Torso.Y < 10 then
warning = false
end
end
end


while true do
wait()
if script.Parent.Parent.Character.Humanoid ~= nil then
start()
end
end


I am trying to get it where when the torso reaches a sertain point on Vector3.Y it will cause health loss... Altitude Sickness!
Report Abuse
Sam010100001 is not online. Sam010100001
Top 100 Poster
Joined: 09 Aug 2009
Total Posts: 34814
22 Dec 2011 05:54 PM
if Torso.Y >= 10 then
local health = script.Parent.Parent.Character.Humanoid.Health
local warning = script.Parent.AltitudeSickness.Frame.Visible
health = health - 10
warning = true
wait(3)
if Torso.Y =< 10 then
warning = false
end
end
end

What Pumpkin?
Report Abuse
jimmybolt77 is not online. jimmybolt77
Joined: 06 Jul 2008
Total Posts: 292
22 Dec 2011 05:55 PM
What exactly is wrong with it..?
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
22 Dec 2011 05:57 PM
error on line 9. = expected near then... Do i flip the < and the =?
Report Abuse
Sam010100001 is not online. Sam010100001
Top 100 Poster
Joined: 09 Aug 2009
Total Posts: 34814
22 Dec 2011 06:07 PM
Yes

What Pumpkin?
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
22 Dec 2011 06:07 PM
I still need help...
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
22 Dec 2011 06:08 PM
Tried that and it didnt work but gave no error
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
22 Dec 2011 06:09 PM
Again here is what I have:

health = script.Parent.Parent.Character.Humanoid.Health
warning = script.Parent.AltitudeSickness.Frame.Visible
Torso = script.Parent.Parent.Character.Torso.Position

function start()
if Torso.Y >= 10 then
health = health - 10
warning = true
wait(3)
if Torso.Y <= 10 then
warning = false
end
end
end

while true do
wait()
if script.Parent.Parent.Character.Humanoid ~= nil then
start()
end
end
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
22 Dec 2011 06:18 PM
hello?
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
22 Dec 2011 06:26 PM
still stuck on this script
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
22 Dec 2011 06:39 PM
...
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
22 Dec 2011 06:42 PM
fixed a few things but its still not working and gives no errors:

health = script.Parent.Parent.Character.Humanoid.Health
warning = script.Parent.AltitudeSickness.Frame.Visible
Torso = script.Parent.Parent.Character.Torso.Position

function start()
if Torso.Y > 10 then
health = health - 10
warning = true
wait(3)
else
warning = false
end
end

while true do
wait()
if script.Parent.Parent.Character.Humanoid ~= nil then
start()
end
end

Its suppost to find the value of the Axis y on the torso position but it wont find it...
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
22 Dec 2011 06:52 PM
:( sad face...
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
22 Dec 2011 06:59 PM
anyone?
Report Abuse
1pie23 is not online. 1pie23
Joined: 11 Jul 2010
Total Posts: 1865
22 Dec 2011 07:33 PM
omg it deleted my comment!
1 sec i'll post it again it works trust me
Report Abuse
1pie23 is not online. 1pie23
Joined: 11 Jul 2010
Total Posts: 1865
22 Dec 2011 07:34 PM
function start()
if Torso.Y > 10 then
health = health - 10
warning = true
wait(3)
elseif Torso.Y <= 10 then
warning = false
end
end

while true do
wait()
if script.Parent.Parent.Character.Humanoid ~= nil then
start()
end
end

Report Abuse
1pie23 is not online. 1pie23
Joined: 11 Jul 2010
Total Posts: 1865
22 Dec 2011 07:35 PM
I forgot to add your variables, but you get my point
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image