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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 31 May 2011 |
| Total Posts: 509 |
|
|
| 31 Mar 2015 08:07 AM |
| Piattaforma.CFrame = Piattaforma.CFrame * CFrame.new(0,1,0) |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2015 08:07 AM |
cause you didn't define cliccato.
A.K.A Piattaforma
Piattaforma.ClickDetector.MouseClick:connect(cliccato) |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 31 Mar 2015 08:14 AM |
^lie,
Replace this: cliccato.ClickDetector.MouseClick:connect()
With this: Piattaforma.ClickDetector.MouseClick:connect(cliccato) |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|