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: Some questions about scripting

Previous Thread :: Next Thread 
wolfcrazy101 is not online. wolfcrazy101
Joined: 05 Aug 2008
Total Posts: 582
19 Aug 2011 03:49 PM
how do you make a script that effects all the players in the game?

I'm making a script that does damage to "humanoids" (lower case "h") but doesn't do damage to "Humanoids" (upper case "H").

also, how do you make a script that only effects members of a certain team?
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
19 Aug 2011 03:52 PM
[ Content Deleted ]
Report Abuse
wolfcrazy101 is not online. wolfcrazy101
Joined: 05 Aug 2008
Total Posts: 582
19 Aug 2011 03:56 PM
i didnt mean team as in group, i meant team (like red team)
Report Abuse
SarahAngel is not online. SarahAngel
Joined: 12 Dec 2009
Total Posts: 2166
19 Aug 2011 03:58 PM
No requests.
Report Abuse
wolfcrazy101 is not online. wolfcrazy101
Joined: 05 Aug 2008
Total Posts: 582
19 Aug 2011 03:59 PM
so would this work?

v = player
v.Character = Player.Character

while true do
wait(0.01)
for _,v in pairs (game:GetService("Players"):GetPlayers()) do
if FindFirstChild("humanoid") then
humanoid.Health < 100
else nil
end
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
19 Aug 2011 04:00 PM
[ Content Deleted ]
Report Abuse
wolfcrazy101 is not online. wolfcrazy101
Joined: 05 Aug 2008
Total Posts: 582
19 Aug 2011 04:01 PM
this isnt a request, its a scripting question. im not asking for anyone to write the script for me.
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
19 Aug 2011 04:02 PM
[ Content Deleted ]
Report Abuse
wolfcrazy101 is not online. wolfcrazy101
Joined: 05 Aug 2008
Total Posts: 582
19 Aug 2011 04:03 PM
like this? sorry if this is a stupid question, im pretty new to scripting, and im attempting to script my first game.

while true do
wait(0.01)
for _,v in pairs (game:GetService("Players"):GetPlayers()) do
v = player v.Character = Player.Character
if FindFirstChild("humanoid") then
humanoid.Health < 100
else nil
end
Report Abuse
wolfcrazy101 is not online. wolfcrazy101
Joined: 05 Aug 2008
Total Posts: 582
19 Aug 2011 04:05 PM
the thing is, i want the health to drain until it reaches 0, so would i use
Health < 100?
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
19 Aug 2011 04:06 PM
for i = 100,0,-1 do
humanoid.Health = i

^^put that in your script

~~ In Soviet Russia, scripts write you. ~~
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
19 Aug 2011 04:09 PM
[ Content Deleted ]
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
19 Aug 2011 04:09 PM
[ Content Deleted ]
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
19 Aug 2011 04:09 PM
@myrc

he wants it to drain. :/

~~ In Soviet Russia, scripts write you. ~~
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
19 Aug 2011 04:10 PM
TakeDamage drains? I don't think so... but then again I hardly ever use it.

~~ In Soviet Russia, scripts write you. ~~
Report Abuse
wolfcrazy101 is not online. wolfcrazy101
Joined: 05 Aug 2008
Total Posts: 582
19 Aug 2011 04:11 PM
ok, so is THIS right?


i = 100,0,-1

while true do
wait(0.01)
for _,v in pairs (game:GetService("Players"):GetPlayers()) do
if v.Character.humanoid then
humanoid.Health = 1

end
end
Report Abuse
wolfcrazy101 is not online. wolfcrazy101
Joined: 05 Aug 2008
Total Posts: 582
19 Aug 2011 04:13 PM
i meant to type: "Heath = i"

my bad
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
19 Aug 2011 04:13 PM
while true do
wait(10)
for _,v in pairs (game:GetService("Players"):GetPlayers()) do
if v.Character.humanoid then
for i = 100,0,-1 do
v.Character.Humanoid.Health = i
end
end
end

~~ In Soviet Russia, scripts write you. ~~
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
19 Aug 2011 04:14 PM
whoops. That might crash your game. sorry.


while true do
wait(10)
for _,v in pairs (game:GetService("Players"):GetPlayers()) do
if v.Character.humanoid then
for i = 100,0,-1 do
v.Character.Humanoid.Health = i
wait()
end
end
end


~~ In Soviet Russia, scripts write you. ~~
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
19 Aug 2011 04:14 PM
[ Content Deleted ]
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
19 Aug 2011 04:16 PM
Myrco's right, this is hard for a beginner with almost no experience. Not trying to be mean, but myrco is right, you need to do some reading up.

~~ In Soviet Russia, scripts write you. ~~
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