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 » Game Design
Home Search
 

Re: I need some scripting help

Previous Thread :: Next Thread 
VitoDonatelli is not online. VitoDonatelli
Joined: 11 Aug 2015
Total Posts: 4333
03 Oct 2016 08:09 PM
this is in the player

"h = script.Parent.Humanoid.Health
b = script.Parent.Humanoid

ko = true

while true do
wait(0.1)
if h.Value < 15 then
b.PlatformStand.enabled = true
wait(10)
b.PlatformStand.enabled = false
end
end"

but i get this error when i run it "Workspace.Player1.Script:8: attempt to index global 'h' (a number value)"


Pale was a simple man who liked good music and advanced literature and writing symphonies. One dawn morning in the day he was out painting the ocean that was visible outside his penthouse on the cliffs of Maine, when he heard the doorbell ring.
Report Abuse
VitoDonatelli is not online. VitoDonatelli
Joined: 11 Aug 2015
Total Posts: 4333
03 Oct 2016 08:12 PM
basically, what it's supposed to do is detect when the player's health drops below 15 then make them do a platform stand for 10 seconds


Pale was a simple man who liked good music and advanced literature and writing symphonies. One dawn morning in the day he was out painting the ocean that was visible outside his penthouse on the cliffs of Maine, when he heard the doorbell ring.
Report Abuse
StringedVortex is not online. StringedVortex
Joined: 28 Jun 2015
Total Posts: 1846
03 Oct 2016 08:17 PM
try this

h = script.Parent.Character.Humanoid.Health
b = script.Parent.Character.Humanoid
db = true -- Debounce
ko = true

while true do
wait(0.1)
if db == true then
db = false
if h.Value < 15 then
b.PlatformStand.enabled = true
wait(10)
b.PlatformStand.enabled = false
db = true
end
end
end


when editing the character always remember that you have to enter the Character itself first
Report Abuse
VitoDonatelli is not online. VitoDonatelli
Joined: 11 Aug 2015
Total Posts: 4333
03 Oct 2016 08:27 PM
the script is already in the character actually, I tried using what you said and put it in starter player scripts instead of starter character scripts and i still got the same error "attempt to index global 'h'(a number value)" sadly


Pale was a simple man who liked good music and advanced literature and writing symphonies. One dawn morning in the day he was out painting the ocean that was visible outside his penthouse on the cliffs of Maine, when he heard the doorbell ring.
Report Abuse
StringedVortex is not online. StringedVortex
Joined: 28 Jun 2015
Total Posts: 1846
03 Oct 2016 08:31 PM
h = script.Parent.Character.Humanoid b = script.Parent.Character.Humanoid db = true -- ######## ko = true while true do wait(0.1) if db == true then db = false if h.Health < 15 then b.PlatformStand.enabled = true wait(10) b.PlatformStand.enabled = false db = true end end end when messing with values like that don't ### Value, ### the actual name your editing. its like calling your stepdad by ### name instead of what your supposed to call him.
Report Abuse
StringedVortex is not online. StringedVortex
Joined: 28 Jun 2015
Total Posts: 1846
03 Oct 2016 08:32 PM
i hate roblox.


h = script.Parent.Character.Humanoid.Health
b = script.Parent.Character.Humanoid
db = true -- Debounce
ko = true

while true do
wait(0.1)
if db == true then
db = false
if h.Health =< 15 then
b.PlatformStand.enabled = true
wait(10)
b.PlatformStand.enabled = false
db = true
end
end
end
Report Abuse
VitoDonatelli is not online. VitoDonatelli
Joined: 11 Aug 2015
Total Posts: 4333
03 Oct 2016 08:48 PM
thanks for trying to help me


Pale was a simple man who liked good music and advanced literature and writing symphonies. One dawn morning in the day he was out painting the ocean that was visible outside his penthouse on the cliffs of Maine, when he heard the doorbell ring.
Report Abuse
KreoBox is not online. KreoBox
Joined: 24 Aug 2016
Total Posts: 356
03 Oct 2016 08:55 PM
local human = script.Parent:WaitForChild("Humanoid")
local blocking = false

human.HealthChanged:connect(function()
if not blocking then
if human.Health < 15 then
blocking = true
human.PlatformStand = true
wait(10)
human.PlatformStand = false
blocking = false
end
end
end)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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