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 » Scripters
Home Search
 

Re: Anywhere else i can learn to script? ಠ_ಠ

Previous Thread :: Next Thread 
27StarGhost is not online. 27StarGhost
Joined: 23 Feb 2014
Total Posts: 236
13 Aug 2015 12:37 PM
Well. I've only learned the basics. But it seems some of the roblox wiki script help is a little outdated.... I've even copy and pasted a kill script from the wiki and it didn't work... So where else am i suppose to learn? ಠ_ಠ
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
13 Aug 2015 12:38 PM
A kill script is easy
game.Players.LocalPlayer:TakeDamage(50)
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
13 Aug 2015 12:39 PM
Sorry I meant
game.Players.LocalPlayer.Character.Humanoid:TakeDamage(90)
Report Abuse
27StarGhost is not online. 27StarGhost
Joined: 23 Feb 2014
Total Posts: 236
13 Aug 2015 12:40 PM
@zarman3402 No no no, its much more than that. I was making a Touched function script, but, I was trying to debounce it threw the wikis. And mine just wasn't working. So i copy and pasted their script they provided and it didn't work.
Report Abuse
27StarGhost is not online. 27StarGhost
Joined: 23 Feb 2014
Total Posts: 236
13 Aug 2015 12:46 PM
Eh, anyone? No? Ok. I'll just continue learning threw the wikis...
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
13 Aug 2015 12:46 PM
trust me, the wiki isn't outdated.

can you show us your script?
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
13 Aug 2015 12:47 PM
I started here after watching a few videos
http://www.roblox.com/Forum/ShowPost.aspx?PostID=153548676
check that link out.
Report Abuse
27StarGhost is not online. 27StarGhost
Joined: 23 Feb 2014
Total Posts: 236
13 Aug 2015 12:52 PM
@ instawin Yeah sure. I understand what debounce does but I'm having trouble learning how to debounce.

Here is the script i attempted to make:

De = script.Disabled

local De = true

function kill()
if De == true then
De = false
wait(1)
end
h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
h.Health = h.Health - 5
wait(5)
De = true
end
end

script.Parent.Touched:connect(kill)

And here is the script roblox wiki provided:

local buttonPressed = false

script.Parent.Touched:connect(function(hit)
if not buttonPressed then


buttonPressed = true


if hit.Parent then
hum = hit.Parent:FindFirstChild("Humanoid")
hum.Health = hum.Health - 5
end
wait(3)

buttonPressed = false

end
end)
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
13 Aug 2015 12:54 PM
Better to use the TakeDamage method instead of subtracting it
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
13 Aug 2015 12:55 PM
And it never looked like you called your function
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
13 Aug 2015 12:56 PM
local enabled = true
local downTime = 5

script.Parent.Touched:connect(function(hit)
local hum = hit.Parent:FindFirstChild("Humanoid")
if enabled and hum and hum.Health > 0 then
enabled = false
hum:TakeDamage(hum.MaxHealth)
wait(downTime)
enabled = true
end
end)

try that?
Report Abuse
27StarGhost is not online. 27StarGhost
Joined: 23 Feb 2014
Total Posts: 236
13 Aug 2015 12:59 PM
@instawin, Yeah that surely killed me.
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
13 Aug 2015 01:00 PM
yes, but notice, you'd have to wait 5 seconds again in order for the enabled variable to be true again (the amount of time it usually takes a standard character to respawn)

try it with 2 players.
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
13 Aug 2015 01:00 PM
Anonymous functions are easier for the mind to read. 27, have you called the function by simply typing your functions name with the parenthesis?
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
13 Aug 2015 01:01 PM
zarman, his function was being called. he connected it to the .Touched event, which would call his function every time .Touched was fired.
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
13 Aug 2015 01:05 PM
De = script.Disabled

local De = true

function kill()
if De == true then
De = false
wait(1)
end
h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
h.Health = h.Health - 5
wait(5)
De = true
end
end

script.Parent.Touched:connect(kill)

first thing that is wrong here,

hit is never defined (you forgot to add it as your function's parameter

and you didn't set up your debounce correctly.the function should check if De is already true, and if it isn't, don't execute the rest of the function. if it already true, set it to false so the function wouldn't execute multiple times, kill the humanoid, wait for how long you want the debounce to last, and set De back to true.
Report Abuse
27StarGhost is not online. 27StarGhost
Joined: 23 Feb 2014
Total Posts: 236
13 Aug 2015 01:07 PM
@instawin k, Thanks for the criticism.
Report Abuse
zarman3402 is not online. zarman3402
Joined: 18 May 2013
Total Posts: 1449
13 Aug 2015 01:08 PM
Good thing to know
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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