RobloxHQ Forums

You are not logged in.

Announcement

WARNING: THIS FORUM MAY BE UNSUITABLE FOR LITTLE KIDS. IF YOU THINK YOU'RE A LITTLE KID, PLEASE KEEP THAT IN MIND. Thank you.
DISCLAIMER: ROBLOX HQ IS NOT AFFILIATED WITH ROBLOX IN ANY WAY. NOTHING SAID HERE REFLECTS ON OR IS REPRESENTATIVE OF THE OFFICIAL ROBLOX WEBSITE AND COMPANY.
The Rule is just this - Don't be stupid. (More Rules)
  • Index
  •  » Roblox Stuff
  •  » Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

#26 2008-11-26 9:58 PM

GameMaster761
Forum Gosen
From: Nooth; sector 0-00
Registered: 2008-08-18
Website

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

ClickDetectors that change color on clicked >_>?

Offline

 

#27 2008-11-26 10:16 PM

bob10110
And now we return to our regularly scheduled RHQ.
From: The Interverse
Registered: 2008-07-03
Website

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

RockLee96 wrote:

You didn't really mention this and I've tried so much!
But what about this script, it turns the brick anchored, makes it's transparency to 0.2, then makes it a ball

script.Parent.Anchored = true
wait(1)
script.Parent.Transparency = 0.3
wait(1)
script.Parent.Shape = Ball --THIS IS THE PART THAT NEVER WORKS!!

The error there is that you must either specify a number (which numbered spot "Ball" is on the drop-down list) or a string.

Your script thinks that Ball is a variable.

Change Ball to "Ball" (put quotes around it -- then it'll work).

GiygasMaster761 wrote:

ClickDetectors that change color on clicked >_>?

Code:

function onClick()
script.Parent.BrickColor = BrickColor.new(script.Parent.BrickColor.Number + 1)
if script.Parent.BrickColor.Number > 50 then
script.Parent.BrickColor = BrickColor.new(1)
end
end

script.Parent.ClickDetector.MouseClick:connect(onClick)

Okay, basically what that script does is this:  Whenever the brick in question is clicked, its color goes to the next value in the list of BrickColor values.  The reference for BrickColor values can be found here.  When the value gets larger than 50 it goes back down to the first value (white).

Simple enough, I hope?

(Oh, if you were talking about changing the cursor for ClickDetectors...can't do that, I'm afraid.)


http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&UserName=bob10110
Scripting Tutorial
↑ ↑ ↓ ↓ ← → ← → B A
♥ ♦ ♣ ♠

Offline

 

#28 2008-11-27 6:58 PM

hawky076
Forum Super Veteran
From: H-Labs :D
Registered: 2008-08-25
Website

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Script wrote:

print("CFrame Elevator Script Activated")
while true do
Object1 = game.Workspace.CFrameElevator.Base
Object1.CFrame = CFrame.new(Vector3.new(0,10,0))
wait(30)
end

This Script  is for a tele-elevator but the base of it teleports with out the rest of the elevator. I welded it all together and nothing seems to work. btw if the roof Is welded to the wall will it tele? If not I have another idea that should work.

I also need this script On Clicked if not, On touched. I'm making different locations for this elevator.

Thanks Bob


http://i41.tinypic.com/s29l48.pnghttp://i39.tinypic.com/auipmf.pnghttp://i41.tinypic.com/2zdwsw4.png
KAMIKAZE WATERMELON!
H-Labs
H-Labs Website

Offline

 

#29 2008-11-30 3:24 PM

Kretin
Forum Super VIP
From: The infinate timeline
Registered: 2008-10-11

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Is there a way for a script to choose a random person on each team and change there name to V.I.P

And how would I go about to make another script saying if V.I.P dies then regen map choose new V.I.P


Can you simplify the making a leaderboard that does this kill v.i.p gets 1 point


In thy Deathbed I die. In thy Deathbed I wake. My presence is eternal.~Eternalseph
In the Deathbed I lie dreaming of my eternal though~Everlasting
I have awaken my presence now eternal, everlasting, eternal, Forever~Kretin
http://forums.robloxhq.com/viewtopic.ph … 5&p=48  Click to ban me and others.

Offline

 

#30 2008-11-30 4:00 PM

bob10110
And now we return to our regularly scheduled RHQ.
From: The Interverse
Registered: 2008-07-03
Website

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

hawky076 wrote:

Script wrote:

print("CFrame Elevator Script Activated")
while true do
Object1 = game.Workspace.CFrameElevator.Base
Object1.CFrame = CFrame.new(Vector3.new(0,10,0))
wait(30)
end

This Script  is for a tele-elevator but the base of it teleports with out the rest of the elevator. I welded it all together and nothing seems to work. btw if the roof Is welded to the wall will it tele? If not I have another idea that should work.

I also need this script On Clicked if not, On touched. I'm making different locations for this elevator.

Thanks Bob

Just a second while I test two different theories:

(A)  Take out the Vector3.new part
(B)  Create another Vector3.new part, separating the two by a comma

Kretin wrote:

Is there a way for a script to choose a random person on each team and change there name to V.I.P

And how would I go about to make another script saying if V.I.P dies then regen map choose new V.I.P


Can you simplify the making a leaderboard that does this kill v.i.p gets 1 point

Sure.  What you'd want to do is check the TeamColor of each player [game.Players.PLAYERNAME.TeamColor = BrickColor.new()] and use the Color Reference to find what TeamColors you've got.  Bright red equates to 21, Bright blue is 23.  Other colors, you're best off using Find (CTRL + F) to find it in the list.

Once you find your colors, make a for loop to check each Player's TeamColor with an if statement.  So a chunk of the code might look like this:

Code:

players = game.Players:getChildren()
for i = 1, #players do
        if players[i].TeamColor == BrickColor.new(21) then  --Comment:  If on the Bright Red team...
                --Another comment:  Do stuff to the red team here.
        end
end

So now that you can do stuff just to the Red team, put them all into a group.  Erm, wait...I haven't covered that yet (it'll be in the fourth lesson when I get there).  In the meantime I'll try to whip up that script when I'm not busy.

But essentially you'd group all the red players together in a temporary table, then select one of THOSE at random to be the VIP.  You'd do something special to the VIP (such as inserting an IntValue into the player's Character) so that an "onDied" script can know for sure that the VIP was killed.

As far as editing the leaderboard goes, it'd require a tiny bit of work but it could also work off of that IntValue inserted earlier.


http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&UserName=bob10110
Scripting Tutorial
↑ ↑ ↓ ↓ ← → ← → B A
♥ ♦ ♣ ♠

Offline

 

#31 2008-11-30 4:16 PM

Kretin
Forum Super VIP
From: The infinate timeline
Registered: 2008-10-11

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Thank you but how would I select one random person from the team. And how do i change a person name?


In thy Deathbed I die. In thy Deathbed I wake. My presence is eternal.~Eternalseph
In the Deathbed I lie dreaming of my eternal though~Everlasting
I have awaken my presence now eternal, everlasting, eternal, Forever~Kretin
http://forums.robloxhq.com/viewtopic.ph … 5&p=48  Click to ban me and others.

Offline

 

#32 2008-11-30 5:43 PM

bob10110
And now we return to our regularly scheduled RHQ.
From: The Interverse
Registered: 2008-07-03
Website

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Changing their name is relatively easy.

Code:

game.Players.Kretin.Character.Name = "VIP"

Unfortunately, it's a bit harder to choose a random person on each team.  I'll whip that script up sometime.  Just know that it involves table.insert.


http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&UserName=bob10110
Scripting Tutorial
↑ ↑ ↓ ↓ ← → ← → B A
♥ ♦ ♣ ♠

Offline

 

#33 2008-11-30 7:44 PM

Kretin
Forum Super VIP
From: The infinate timeline
Registered: 2008-10-11

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Thank you hopefully I will be around when you are done.




I devised my own demise


In thy Deathbed I die. In thy Deathbed I wake. My presence is eternal.~Eternalseph
In the Deathbed I lie dreaming of my eternal though~Everlasting
I have awaken my presence now eternal, everlasting, eternal, Forever~Kretin
http://forums.robloxhq.com/viewtopic.ph … 5&p=48  Click to ban me and others.

Offline

 

#34 2008-12-14 4:10 AM

bob10110
And now we return to our regularly scheduled RHQ.
From: The Interverse
Registered: 2008-07-03
Website

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Finally started working on Lesson #3.

It's not done yet.  I'm heading off to bed as it is 4 in the morning.  Good night...morning...whatever.  (Zzz...)


http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&UserName=bob10110
Scripting Tutorial
↑ ↑ ↓ ↓ ← → ← → B A
♥ ♦ ♣ ♠

Offline

 

#35 2008-12-14 4:58 PM

freefurbie
Forum VIP
From: in ur pantz
Registered: 2008-06-19
Website

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Lol, I was so happy the day I learned I could use ROBLOX as a caculator XD


Why am I here again

Offline

 

#36 2008-12-14 5:51 PM

WeakestLINK
Forum VIP
Registered: 2008-09-27
Website

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Indexing is the part I never really got down...

Thanks, bob! This is excellent!


http://i340.photobucket.com/albums/o360/doombringer42/weakestlink-1.png
                       "Animoo is what cows watch." -Stonecycle, July 18, 2010
          chumHandle: arbitraryConstant; battle.net: crazypitlord; steam: veva09;
              Zodiac: Aries; ROBLOX: doombringer42; minecraft: crazypitlord

Offline

 

#37 2008-12-15 6:18 PM

MrWillyWonnka
Forum Super Veteran
From: WB for aale: 50 tix!
Registered: 2008-10-08

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Heres My Script I made,



script.Parent.Anchored = true
wait(1)
script.Parent.Transparency = 1
wait(1)
script.Parent.Transparency = 0
wait(1)
script.Parent.Transparency = 0.1
wait(1)
script.Parent.Transparency = 0.2
wait(1)
script.Parent.Transparency = 0.3
wait(1)
script.Parent.Transparency = 0.4
wait(1)
script.Parent.Transparency = 0.5
wait(1)
script.Parent.Transparency = 0.6
wait(1)
script.Parent.Transparency = 0.7
wait(1)
script.Parent.Transparency = 0.8
wait(1)
script.Parent.Transparency = 0.9
--And BAM! Theres My Script--


This post is brought to you by Wonka Bars!
They're insanely yummy!

Offline

 

#38 2008-12-20 7:56 AM

goko305
Forum User
Registered: 2008-12-18

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Ths guide is great, I made some decent (well decent for me) scripts! like this:

x=5
while true do
script.Parent.Anchored = true
script.Parent.Transparency = .1
wait(.0001)
script.Parent.Transparency = .2
wait(.0001)
script.Parent.Transparency = .3
wait(.0001)
script.Parent.Transparency = .4
wait(.0001)
script.Parent.Transparency = .5
wait(.0001)
script.Parent.Transparency = .6
wait(.0001)
script.Parent.Transparency = .7
wait(.0001)
script.Parent.Transparency = .8
wait(.0001)
script.Parent.Transparency = .9
wait(.0001)
script.Parent.Transparency = 1
wait(.0001)
script.Parent.Transparency = .9
wait(.0001)
script.Parent.Transparency = .8
wait(.0001)
script.Parent.Transparency = .7
wait(.0001)
script.Parent.Transparency = .6
wait(.0001)
script.Parent.Transparency = .5
wait(.0001)
script.Parent.Transparency = .4
wait(.0001)
script.Parent.Transparency = .3
wait(.0001)
script.Parent.Transparency = .2
wait(.0001)
script.Parent.Transparency = .1
wait(.0001)
script.Parent.Transparency = 0
end


Check out my friend's Obby!

http://www.roblox.com/Item.aspx?ID=5551333

Offline

 

#39 2008-12-20 1:11 PM

OzJB1
Forum Veteran
From: SPARTAAAAAAAA!f Posts:∞
Registered: 2008-09-10

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Lesson #3 stopped right when it was getting to the good part! D:


My ROBLOX: OzJB

Offline

 

#40 2008-12-20 1:23 PM

bob10110
And now we return to our regularly scheduled RHQ.
From: The Interverse
Registered: 2008-07-03
Website

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Oh, don't worry.  I'll be finishing it up soon enough.  I think I'll go do that now, actually.


http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&UserName=bob10110
Scripting Tutorial
↑ ↑ ↓ ↓ ← → ← → B A
♥ ♦ ♣ ♠

Offline

 

#41 2008-12-20 3:03 PM

Latio
щ(゚Д゚щ)
From: Indiana
Registered: 2008-06-19
Website

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Thanks for the lessons!

I made this script with my newfound knowledge.

Code:

t = 1
while true do
wait(0.2)
script.Parent.BrickColor = BrickColor.new(t)
print(script.Parent.BrickColor)
print("-----------------------------------------")
t = t + 1
end

after a while, it just repeats Medium Stone Grey... ill try and fix that so it loops.

Last edited by latiosslayer (2008-12-20 3:04 PM)


http://i47.tinypic.com/2gukqc4.png

Offline

 

#42 2008-12-20 3:07 PM

fireflywater
Forum Super VIP
From: Here, To: There.
Registered: 2008-08-04
Website

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Code:

while true do
for i = 1, 20 do
script.Parent.Size = Vector3.new(i, i, i)
script.Parent.Transparency = i / 20
script.Parent.CFrame = script.Parent.CFrame
wait(0.1)
end
wait(0.1)
end

http://i38.tinypic.com/11buutd.png
"GameMaster761: they would you name the names of bugs"; "WHERE'D YOU GET YOUR LICENCE? FROM A CEREAL BOX?"; "Give it to me stright, do I look fat in these tights?"

Offline

 

#43 2008-12-20 3:28 PM

bob10110
And now we return to our regularly scheduled RHQ.
From: The Interverse
Registered: 2008-07-03
Website

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Well, next up is for me to add to the given scripting problem to include uses for "and", "or", & "not".

I'll do that later.


http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&UserName=bob10110
Scripting Tutorial
↑ ↑ ↓ ↓ ← → ← → B A
♥ ♦ ♣ ♠

Offline

 

#44 2008-12-20 4:00 PM

OZZY941
Forum Super Veteran
From: {Classified}
Registered: 2008-06-19
Website

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Nice guide. The first guide made scripting feel easy :D


....My kirby signature broke D:

Offline

 

#45 2008-12-23 12:28 AM

RinKaenbyou
Forum User
From: Hell
Registered: 2008-12-21

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Might i bump?

Code:

game.Workspace:InsertContent(URLHERE)

Offline

 

#46 2008-12-23 5:09 PM

Byndley
Forum Super-Cool VIP
From: math.huge +1
Registered: 2008-07-08
Website

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Wait, so I how could I specify all of the bricks in the model in a script?


http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&UserName=Byndley http://i177.photobucket.com/albums/w204/UNX789/byndley2.gif http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&UserName=Byndley
Follow me on Twitter!
Thanks BlooWolf for the Signature! I'm hoping to get a new one, *hint* *hint*.

Offline

 

#47 2008-12-23 5:12 PM

Charcermanter
Forum Gosen
From: reproductive organs
Registered: 2008-08-18

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

RinKaenbyou wrote:

Might i bump?

Code:

game.Workspace:InsertContent(URLHERE)

Wait a minute...

How the hell do you know about scripting?


i'm done

Offline

 

#48 2008-12-23 5:12 PM

RinKaenbyou
Forum User
From: Hell
Registered: 2008-12-21

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Charcermanter wrote:

RinKaenbyou wrote:

Might i bump?

Code:

game.Workspace:InsertContent(URLHERE)

Wait a minute...

How the hell do you know about scripting?

I read, unlike you.

Offline

 

#49 2008-12-23 5:14 PM

Charcermanter
Forum Gosen
From: reproductive organs
Registered: 2008-08-18

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

RinKaenbyou wrote:

Charcermanter wrote:

RinKaenbyou wrote:

Might i bump?

Code:

game.Workspace:InsertContent(URLHERE)

Wait a minute...

How the hell do you know about scripting?

I read, unlike you.

Uh.. I just posted without seeing the thread name.. Sorry >_>


i'm done

Offline

 

#50 2008-12-23 5:25 PM

Byndley
Forum Super-Cool VIP
From: math.huge +1
Registered: 2008-07-08
Website

Re: Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Can anyone help me?
>_>
I made thread but I lost it. ._.

To do it, don't I have to find the model's children?


http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&UserName=Byndley http://i177.photobucket.com/albums/w204/UNX789/byndley2.gif http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&UserName=Byndley
Follow me on Twitter!
Thanks BlooWolf for the Signature! I'm hoping to get a new one, *hint* *hint*.

Offline

 
  • Index
  •  » Roblox Stuff
  •  » Bob10110's Scripting Guide. (Lesson #3 nearing completion!)

Board footer

Powered by PunBB 1.2.20
© Copyright 2002–2008 PunBB