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: The First Script I Made By My Self!

Previous Thread :: Next Thread 
Distriction is not online. Distriction
Joined: 25 Mar 2012
Total Posts: 655
19 Apr 2012 07:40 PM
mdl = script.Parent.Parent

local ting = 0 --debouncer

function onTouched(hit)

if ting == 0 then --debounce check
ting = 1 --activate debounce
check = hit.Parent:FindFirstChild("Humanoid") --Find the human that touched the button

if check ~= nil then --If a human is found, then

local user = game.Players:GetPlayerFromCharacter(hit.Parent) --get player from touching human
local stats = user:findFirstChild("leaderstats") --Find moneyholder

if stats ~= nil then --If moneyholder exists then
local cash = stats:findFirstChild("Money") --Get money
cash.Value = cash.Value +250 --increase amount of money by the number displayed here (500)
check.Health = "0" --kills noob so he can't keep claiming money
script.Parent.Transparency = "0.5" --shows the player it is inactive by changing reflectancy
mdl.Name = "+250 (5 Seconds until active)" --changes the name, it will be displayed above the brick
wait(1) --wait-time before button works again
mdl.Name = "+250 (4 Seconds until active)" --changes the name, it will be displayed above the brick
wait(1) --still waiting
mdl.Name = "+250 (3 Seconds until active)" --changes the name, it will be displayed above the brick
wait(1) --still waiting
mdl.Name = "+250 (2 Seconds until active)" --changes the name, it will be displayed above the brick
wait(1) --still waiting
mdl.Name = "+250 (1 Second until active)" --changes the name, it will be displayed above the brick
wait(1) --still waiting
script.Parent.Transparency = "0" --reverts reflectancy
mdl.Name = "+250 (5 second cooldown)" --changes back to original name
end

end

ting = 0 --remove debounce
end

end

script.Parent.Touched:connect(onTouched)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
19 Apr 2012 07:41 PM
What's with all the comments?

† KMXD †
Report Abuse
Distriction is not online. Distriction
Joined: 25 Mar 2012
Total Posts: 655
19 Apr 2012 07:46 PM
Open-sourced it for one of my friends who's trying to understand how I did it, we're both lua noobs.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
19 Apr 2012 08:22 PM
I doubt that's your first script.

My first script was this.

game.Workspace.miz656.Head:Destroy()

And that's only one line.
Report Abuse
Distriction is not online. Distriction
Joined: 25 Mar 2012
Total Posts: 655
19 Apr 2012 08:37 PM
Well I've done that, but I didn't consider that a script, I mean something someone else could find useful perhaps.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
19 Apr 2012 08:38 PM
That code could be VERY useful. Image you want a loopkill. You could use that piece of script to combine with another script.
Report Abuse
Distriction is not online. Distriction
Joined: 25 Mar 2012
Total Posts: 655
19 Apr 2012 08:40 PM
I understand, but that sole line alone isn't what I would consider to be a full script. I've done things like that, or changing decals over a period of time, or transparency, cancolide, ect.
Report Abuse
mage11561 is not online. mage11561
Joined: 03 Sep 2008
Total Posts: 13217
19 Apr 2012 08:40 PM
why do i feel that i've seen this on a tutorial before as a sample script.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
19 Apr 2012 08:41 PM
@mage

You had.

It's just I hadn't :)

Still, it's a script.
Report Abuse
Distriction is not online. Distriction
Joined: 25 Mar 2012
Total Posts: 655
19 Apr 2012 08:42 PM
Probably because I based it off a script that gave you money on touch, except I added a cooldown, transparency, and name changes, as well as death.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
19 Apr 2012 08:43 PM
Well if you're adding things, you technically didn't make it (by yourself), but it's still pretty good.

† KMXD †
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
19 Apr 2012 08:45 PM
Not his first script.
Report Abuse
Distriction is not online. Distriction
Joined: 25 Mar 2012
Total Posts: 655
19 Apr 2012 08:45 PM
I didn't add things, I just looked at things from other scripts, then added -- to make notes of what I was doing. Well, okay, I guess that's the same thing. Thanks anyways. I'm just trying to figure out all the variables. Next I'm trying to learn is velocity.
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