punyman9
|
  |
| Joined: 09 May 2009 |
| Total Posts: 1158 |
|
|
| 12 Dec 2011 04:14 PM |
I basically know all dealing with building, and I want to find all the secret secrets to the magic of scripting. I'm not saying a specific script YET. I just want some pointers, maybe a scripting teacher? That would be really helpful. All I know right now is that you have to put
Workspace.
at the beginning of every script.
Any help would be very nice, but nothing to technical.
Thanks -Puny:) |
|
|
| Report Abuse |
|
|
punyman9
|
  |
| Joined: 09 May 2009 |
| Total Posts: 1158 |
|
|
| 12 Dec 2011 04:17 PM |
| Oh, and I just saw an ad for a scripting teacher, but you have to pay.. I'm really hoping I won't have to because I'm kinda broke. :/ |
|
|
| Report Abuse |
|
|
|
| 12 Dec 2011 04:17 PM |
The wiki teaches for free. wiki.roblox.com
- ~Cool Kid just got let loose.~ |
|
|
| Report Abuse |
|
|
punyman9
|
  |
| Joined: 09 May 2009 |
| Total Posts: 1158 |
|
|
| 12 Dec 2011 04:32 PM |
With a bit of help from the wiki, I learned how to do this
workspace.Script.remove()
Just removed the script I made it on. :D
My first actual script besides
'Hello World!'
Thanks, Willingroblox123! |
|
|
| Report Abuse |
|
|
comiconor
|
  |
| Joined: 26 May 2009 |
| Total Posts: 16893 |
|
| |
|
punyman9
|
  |
| Joined: 09 May 2009 |
| Total Posts: 1158 |
|
|
| 12 Dec 2011 04:43 PM |
I think the first script is a brick changing color. But I'm not sure what all the 'alarm' is. Like I said, I'm just now learning how to. The wiki's really helpful.
The second script, I think it might be a Lighting changing script. Again, 'alarm' is kind of confusing. |
|
|
| Report Abuse |
|
|
punyman9
|
  |
| Joined: 09 May 2009 |
| Total Posts: 1158 |
|
|
| 12 Dec 2011 04:43 PM |
| About fixing the script, probably not.. |
|
|
| Report Abuse |
|
|
punyman9
|
  |
| Joined: 09 May 2009 |
| Total Posts: 1158 |
|
|
| 12 Dec 2011 05:16 PM |
I learned basic scripts, like removing anything from workspace. I know about parents, childs, but what are functions? I think it's a script that makes something happen. I want to learn about those.
-Puny:) |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 12 Dec 2011 05:18 PM |
"workspace.Script.remove()"
Close, but since the Remove function operates on workspace.Script, you use a colon (:) instead of a dot. Also, remove() is depreciated, so you should use Destroy() instead.
workspace.Script:Destroy()
---------- ~ pwnedu46, the unicorn ~ |
|
|
| Report Abuse |
|
|
|
| 12 Dec 2011 05:18 PM |
function CallMe() print("Hai") end
C0allMe() CallMe()
-->Hai -->Hai |
|
|
| Report Abuse |
|
|
|
| 12 Dec 2011 05:19 PM |
function CallMe() print("Hai") end
CallMe() CallMe()
-->Hai -->Hai |
|
|
| Report Abuse |
|
|
|
| 12 Dec 2011 05:23 PM |
"script.Parent.Alarn:stop()" Alarm* |
|
|
| Report Abuse |
|
|
punyman9
|
  |
| Joined: 09 May 2009 |
| Total Posts: 1158 |
|
|
| 13 Dec 2011 02:55 PM |
| What does 'alarm' do? Kind of curious. |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2011 03:02 PM |
script.Parent.Alarn:stop() ^ Roblox has a fancy Object Browser for you to find specifics such as this: Stop() and Play() are a part of the Sound Instance. Reading those two parts alone, one can notice the script is for sound manipulation
Also, print, if you don't know it, is good for beginners. When you call print, it sends a message to output for you to see, so you can track how far your script works.
For example, try making a script that only reads: print("Fire!!!")
You're output should now have, Fire!!! Now, try making it say This is the Daily Report.
|
|
|
| Report Abuse |
|
|
|
| 13 Dec 2011 03:06 PM |
@OP
In your first post you said that every script must begin with 'workspace'
THIS IS NOT TRUE!
Most scripts use workspace, but it doesnt have to be there. |
|
|
| Report Abuse |
|
|
punyman9
|
  |
| Joined: 09 May 2009 |
| Total Posts: 1158 |
|
|
| 13 Dec 2011 03:18 PM |
@Script
Yeah, sometimes I scan through a smaller script to know what it's attempting to do. Makes it a bit easier to understand, I guess.
These are the scripts I know so far.
workspace.(object):remove() -- A script to remove anything in workspace.
print("WORDSGOHERE") -- A script for making the words go into output and as a 'message' on your screen.
Oh, and what does 'end' do in scripts? Is it for movements and such to tell it when to stop?
Thanks guys, and correct me if I'm wrong. I've only tried it a couple times. It's what I remember from yesterday.
-Puny:) |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2011 03:57 PM |
Hmmm you said you don't know how to use functions? These are bread and butter.
function iWantCandy() --function Name --stuff print("I want Candy") --example stuff end --functions require ends to signal where their stuff ends
iWantCandy() --calling a function, by function Name
So, when iWantCandy is called, the stuff inside function iWantCandy acts, giving us 'I want Candy'. |
|
|
| Report Abuse |
|
|
punyman9
|
  |
| Joined: 09 May 2009 |
| Total Posts: 1158 |
|
| |
|
punyman9
|
  |
| Joined: 09 May 2009 |
| Total Posts: 1158 |
|
|
| 15 Dec 2011 03:12 PM |
I was thinking about it today, and wrote it on a piece of paper. Can you tell me if this script is right? It's a script that deletes a player(punyman9 for instance)'s head.
Workspace.Players.punyman9.Head:remove()
I think that one's right.
And then the one where you make youe health go to zero.
Workspace.Players.punyman9.Head.Humanoid:Health=0.
If any of these scripts are wrong, please tell me and the corrections. Slowly but surely, a scripter has been born.
-Puny:) |
|
|
| Report Abuse |
|
|
punyman9
|
  |
| Joined: 09 May 2009 |
| Total Posts: 1158 |
|
|
| 15 Dec 2011 03:24 PM |
| Tell me and you get cookie. |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2011 03:28 PM |
Its Game.Workspace.punyman9.Head:Destroy()
|
|
|
| Report Abuse |
|
|
CrasyTrex
|
  |
| Joined: 13 Mar 2011 |
| Total Posts: 761 |
|
|
| 15 Dec 2011 03:29 PM |
Well you made some mistakes on the second one. Workspace.punyman9.Humanoid.Health=0 it was incorrect becuase humanoid is in the players model not the Head.
|
|
|
| Report Abuse |
|
|
CrasyTrex
|
  |
| Joined: 13 Mar 2011 |
| Total Posts: 761 |
|
|
| 15 Dec 2011 03:30 PM |
| did they upgrade the :remove()? I thought you could still do :remove() and were not forced to do :Destroy().... |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2011 03:30 PM |
Or you can do
game.Players.punyman9.Character.Head:Destroy() |
|
|
| Report Abuse |
|
|
punyman9
|
  |
| Joined: 09 May 2009 |
| Total Posts: 1158 |
|
|
| 15 Dec 2011 03:31 PM |
| Yeah you can still do 'remove:()' I just prefer it because that's the way I was first taught. |
|
|
| Report Abuse |
|
|