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 » Scripting Helpers
Home Search
 

Re: Killing player with a button

Previous Thread :: Next Thread 
Blacksun1998 is not online. Blacksun1998
Joined: 06 Aug 2013
Total Posts: 59
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
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
03 Jan 2014 01:33 PM
Plyr = plyr.Character.Torso

ᶁᶖᶏᶆᶗᶇᶁᶀᶅᶐᶁᶒ
Report Abuse
Blacksun1998 is not online. Blacksun1998
Joined: 06 Aug 2013
Total Posts: 59
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 is not online. 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
Blacksun1998 is not online. Blacksun1998
Joined: 06 Aug 2013
Total Posts: 59
04 Jan 2014 04:21 AM
ohh ok. I get it ;o

Thanks alot! helped me alot :)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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