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: Hello! Trying to learn scripting.. (Script I made)

Previous Thread :: Next Thread 
Onore is not online. Onore
Joined: 13 Nov 2011
Total Posts: 32
31 Mar 2015 08:03 AM
I made this script for a moving platform when you click a certain brick:

local Piattaforma = script.Parent.Parent.Piattaforma

function cliccato()
for i=1,10 do
Piattaforma.CFrame = Piattaforma.CFrame + Vector3.new(0,1,0)
end
end

cliccato.ClickDetector.MouseClick:connect()

It doesn't work though..
Can anyone give an hand?
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
31 Mar 2015 08:04 AM
You didn't connect any function to this line:

cliccato.ClickDetector.MouseClick:connect()


Change that to:

cliccato.ClickDetector.MouseClick:connect(cliccato)
Report Abuse
Onore is not online. Onore
Joined: 13 Nov 2011
Total Posts: 32
31 Mar 2015 08:05 AM
Oh that's right!
Thanks a lot!

One error less at least, still not working though ^^
Report Abuse
GOLDC3PO is not online. GOLDC3PO
Joined: 31 May 2011
Total Posts: 509
31 Mar 2015 08:07 AM
Piattaforma.CFrame = Piattaforma.CFrame * CFrame.new(0,1,0)
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
31 Mar 2015 08:07 AM
cause you didn't define cliccato.

A.K.A Piattaforma

Piattaforma.ClickDetector.MouseClick:connect(cliccato)
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
31 Mar 2015 08:07 AM
cliccato isn't defined.
Can't help you since we don't know where the ClickDetector is located.
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
31 Mar 2015 08:11 AM
Try this:

(Sorry I don't have much experience with Vector3's and CFraming).

local Piattaforma = script.Parent.Parent.Piattaforma

function cliccato()
for i = 1, 10, 1 do
Piattaforma.CFrame = Piattaforma.CFrame + Vector3.new(0,1,0)
wait(0.1)
end
end

cliccato.ClickDetector.MouseClick:connect()
Report Abuse
Onore is not online. Onore
Joined: 13 Nov 2011
Total Posts: 32
31 Mar 2015 08:12 AM
Still not working with the "*" but thanks a lot for your help anyway guys!

@Funki

What do you mean with "define"?

the script is currently in this state:

local Piattaforma = script.Parent.Parent.Piattaforma

function cliccato()
for i=1,10 do
Piattaforma.CFrame = Piattaforma.CFrame * Vector3.new(0,1,0)
end
end

cliccato.ClickDetector.MouseClick:connect(cliccato)



@lamp

Clickdetector is in:

game.Workspace.Ascensore.BottonePerDiscesa.ClickDetector
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
31 Mar 2015 08:12 AM
Wait...
I'm so blind.
And go ninja'd.

local Piattaforma = script.Parent.Parent.Piattaforma

function cliccato()
for i=1,10 do
Piattaforma.CFrame = Piattaforma.CFrame + Vector3.new(0,1,0)
end
end

Piattafdorm.ClickDetector.MouseClick:connect() --I think you meant to use Piattafdorm.
Report Abuse
GOLDC3PO is not online. GOLDC3PO
Joined: 31 May 2011
Total Posts: 509
31 Mar 2015 08:12 AM
NO NO NO NO THE PERSON ABOVE IS DUMB DONT LISTEN!!!!

for i=1,10,1 do will do it 20 times!!!!
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
31 Mar 2015 08:14 AM
^lie,

Replace this:
cliccato.ClickDetector.MouseClick:connect()

With this:
Piattaforma.ClickDetector.MouseClick:connect(cliccato)
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
31 Mar 2015 08:15 AM
I got ninja'd again..

local Piattaforma = script.Parent.Parent.Piattaforma

function cliccato()
for i=1, 10, 1 do
Piattaforma.CFrame = Piattaforma.CFrame + Vector3.new(0,1,0)
end
end

Piattaforma.ClickDetector.MouseClick:connect()
Report Abuse
GOLDC3PO is not online. GOLDC3PO
Joined: 31 May 2011
Total Posts: 509
31 Mar 2015 08:16 AM
local Piattaforma = script.Parent.Parent.Piattaforma:GetPart()

function cliccato()
i=0
repeat i=(i+1)*2
Piattaforma.CFrame = Piattaforma.Position * UDim.new(0,1)
until not wait() or i==0
end
end

Piattafdorm.ClickDetector:connect(function()
cliccato(end)
end)
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
31 Mar 2015 08:16 AM
@GOLD

You dumbo.
Report Abuse
GOLDC3PO is not online. GOLDC3PO
Joined: 31 May 2011
Total Posts: 509
31 Mar 2015 08:17 AM
Stop trolling him this guy actually needs help.
Use my script, it should work.
Report Abuse
Onore is not online. Onore
Joined: 13 Nov 2011
Total Posts: 32
31 Mar 2015 08:19 AM
Hahah nothing! this script doesn't want to work but thanks anyway I'll keep trying ;)!

But let me explain:

There's a platform (Piattaforma)
And there's a buttom (which is located in game.Workspace.Ascensore.BottonePerDiscesa)

If I click that buttom, I'd like to have the platform go up ^^

I'm trying Dumbo's way btw! wish me luck!
Report Abuse
Onore is not online. Onore
Joined: 13 Nov 2011
Total Posts: 32
31 Mar 2015 08:20 AM
Sorry I'm not english and I didn't see your name!

I meant GOLDC3PO*!

Report Abuse
GOLDC3PO is not online. GOLDC3PO
Joined: 31 May 2011
Total Posts: 509
31 Mar 2015 08:22 AM
You will probally need to edit mine a bit, like replace the names, etc.
Report Abuse
Onore is not online. Onore
Joined: 13 Nov 2011
Total Posts: 32
31 Mar 2015 08:23 AM
Nothing.. It doesn't work..

Thanks anyway!

My elevator isn't going to work ^^
Report Abuse
Onore is not online. Onore
Joined: 13 Nov 2011
Total Posts: 32
31 Mar 2015 08:27 AM
OK SOMETHING HAS HAPPENED!!

Lol I'm so happy that at least something worked, I'll try to see how it goes!
Thanks a lot!
Report Abuse
GOLDC3PO is not online. GOLDC3PO
Joined: 31 May 2011
Total Posts: 509
31 Mar 2015 08:30 AM
local p = script.Parent.Parent.Piattaforma
local c = Instance.new('ClickDetector',p)
moving=false
c.MouseClick:connect(function(plr)
if moving==false then
moving=true
for i=1, 100 do wait()
p.CFrame=p.CFrame*CFrame.new(0,.1,0)
end
wait(3)
for i=1, 100 do wait()
p.CFrame=p.CFrame*CFrame.new(0,-.1,0)
end
moving=false
end
end)


Click the elevator to make it go up.
Report Abuse
buildersteven4 is not online. buildersteven4
Joined: 08 May 2009
Total Posts: 1325
31 Mar 2015 09:52 AM
Really... Don't listen to GOLDC3PO. He's a complete troll. That other guy was telling the truth.
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