|
| 03 Jan 2014 01:31 PM |
If you want to kill a player by touching a block it is just
the same. but then with Button.touched:connect(Lift) in this script here below
but how to do this with an player?
because it detects the player in the folder Players and not in the workspace.
how can I do this with an button? :s Thanks for help!
Elevator=game.Workspace.Platform Button=game.Workspace.Button
function GoUp(plyr) Plyr= game.Workspace.plyr.Torso for i = 1,50 do Elevator.Position=Elevator.Position+Vector3.new(0,0.1,0) Plyr.Position=Elevator.Position+Vector3.new(0,0.1,0) wait(0.01) end end
Button.ClickDetector.MouseClick:connect(GoUp) |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2014 01:33 PM |
Plyr = plyr.Character.Torso
ᶁᶖᶏᶆᶗᶇᶁᶀᶅᶐᶁᶒ |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2014 02:19 PM |
Oh lol, i feel stupid right now :$
1 more question, why this doesnt work?
Elevator=game.Workspace.Elevator Button=game.Workspace.Button
function GoUp(plyr) Plyr = plyr.Character.Torso for i = 1,50 do Elevator.Position = Elevator.Position + Vector3.new(0,0.1,0) Plyr.CFrame = Elevator.Position + CFrame.new(Vector3.new(0,1,0)) wait(0.01) end end
Button.ClickDetector.MouseClick:connect(GoUp)
I tried Plyr.CFrame = Elevator.Position + CFrame.new(Vector3.new(0,1,0)) Plyr.CFrame = Elevator.Position + CFrame.new(0,1,0) Plyr.CFrame = Elevator.CFrame + CFrame.new(0,1,0) Plyr.CFrame = Elevator.CFrame + Vector3.new(0,1,0)
i tried almost everything. but i can't get it working. it is always telling me
21:18:37.572 - Workspace.Button.script:8: bad argument #2 to '?' (Vector3 expected, got userdata) 21:18:37.572 - Script 'Workspace.Button.script', Line 8 21:18:37.573 - stack end 21:18:37.573 - Disconnected event because of exception
that it expects something but it gets Userdata. what is userdata? what do i do wrong? why it doesnt take the vector3? :s |
|
|
| Report Abuse |
|
|
Thaeh
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 7685 |
|
|
| 03 Jan 2014 02:26 PM |
cframe isnt made up of 3 arguemnts like vector3, so you cant just make it equal to a vector3 (userdata) then sum something to it without declaring the coordinates
so like
Plyr.CFrame = CFrame.new(Elevator.Position.x, Elevator.Position.y + 1, Elevator.Position.z) |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 04:21 AM |
ohh ok. I get it ;o
Thanks alot! helped me alot :) |
|
|
| Report Abuse |
|
|