koke15
|
  |
| Joined: 29 Sep 2010 |
| Total Posts: 3909 |
|
|
| 13 Aug 2014 10:31 PM |
It's my first ever script I made and it is supposed to give the played 99999 Wipeouts, but it only gives one, then stops working.
function onTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") if (humanoid ~= nil) then -- if a humanoid exists, then humanoid.Health = 0 -- damage the humanoid player.leaderstats.Wipeouts.Value = 99999 end end
script.Parent.Touched:connect(onTouch)
|
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
| |
|
koke15
|
  |
| Joined: 29 Sep 2010 |
| Total Posts: 3909 |
|
|
| 13 Aug 2014 10:38 PM |
| aAAA I AM NEW TO THE LUA WORLD |
|
|
| Report Abuse |
|
|
Cetharis
|
  |
| Joined: 27 Jul 2012 |
| Total Posts: 25 |
|
|
| 13 Aug 2014 11:14 PM |
player is not defined.
if it's a local script than you can use
player=game.Players.LocalPlayer
player.leaderstats.Wipeouts.Value = 99999 |
|
|
| Report Abuse |
|
|
koke15
|
  |
| Joined: 29 Sep 2010 |
| Total Posts: 3909 |
|
| |
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 13 Aug 2014 11:21 PM |
dont listen to that bozo. That won't work online but gg anyways You need to get the player from the character that TOUCHED it
function onTouch(part) local humanoid = part.Parent:FindFirstChild("Humanoid") if (humanoid ~= nil) and game:GetService("Players"):GetPlayerFromCharacter(part.Parent) then -- if a humanoid exists, then local player=game:GetService("Players"):FindFirstChild(part.Parent.Name) humanoid.Health = 0 -- damage the humanoid player.leaderstats.Wipeouts.Value = 99999 end end |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 13 Aug 2014 11:21 PM |
| forgot to put the connection line as I was just correcting a function. |
|
|
| Report Abuse |
|
|
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
|
| 13 Aug 2014 11:22 PM |
eww why did you say game:GetServive'Players' just say game.Players:GetPlayerFromCharacter(hit.Parent)
http://www.roblox.com/--item?id=171600495 |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 13 Aug 2014 11:23 PM |
| Because I do, deal with it. |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 13 Aug 2014 11:26 PM |
| And by the way, I used parenthesis and double quotes. Also it's part, not hit. Too used to editing free models, eh? |
|
|
| Report Abuse |
|
|
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
|
| 13 Aug 2014 11:26 PM |
No, I have NEVER seen that before and I didn't remember the exact format.
http://www.roblox.com/--item?id=171600495 |
|
|
| Report Abuse |
|
|
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
|
| 13 Aug 2014 11:27 PM |
I never use free models, it is morally wrong.
http://www.roblox.com/--item?id=171600495 |
|
|
| Report Abuse |
|
|
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
|
| 13 Aug 2014 11:29 PM |
And I said hit because that is what I use to represent the part that hit the block when I make similar scripts.
http://www.roblox.com/--item?id=171600495 |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 13 Aug 2014 11:29 PM |
| It isn't morally wrong, people learn that way. And, if you didn't know GetService will return Players even if Players isn't named Players. Whereas you are just indexing "Players" straight up. |
|
|
| Report Abuse |
|
|
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
|
| 13 Aug 2014 11:30 PM |
Renaming Players is just stupid, so if you are dumb enough to do that, than you deserve your script to malfunction.
http://www.roblox.com/--item?id=171600495 |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 13 Aug 2014 11:30 PM |
| Who said you are doing it? How about an exploiter? |
|
|
| Report Abuse |
|
|
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
|
| 13 Aug 2014 11:31 PM |
then*
http://www.roblox.com/--item?id=171600495 |
|
|
| Report Abuse |
|
|
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
|
| 13 Aug 2014 11:32 PM |
Why would an exploiter take the time to rename Players?
http://www.roblox.com/--item?id=171600495 |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
| |
|
IcyFires
|
  |
| Joined: 29 Jun 2013 |
| Total Posts: 5046 |
|
|
| 13 Aug 2014 11:38 PM |
You have a point there. But for a script like this? It's a waste of time to type that.
http://www.roblox.com/--item?id=171600495 |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
| |
|
koke15
|
  |
| Joined: 29 Sep 2010 |
| Total Posts: 3909 |
|
| |
|