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: How to use player =?

Previous Thread :: Next Thread 
DOMINIK123456 is not online. DOMINIK123456
Joined: 19 Oct 2006
Total Posts: 91
13 Apr 2017 07:54 AM
arena = game.Workspace.PVP
player = ????

arena.Touched:connect(function()
player.CanDamage.Value = true
end)
arena.TouchEnded:connect(function()
player.CanDamage.Value = false
end)



Report Abuse
Nitro509 is not online. Nitro509
Joined: 27 Jun 2010
Total Posts: 11170
13 Apr 2017 09:34 AM
Depends on the properties you're trying to use.


Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
13 Apr 2017 09:36 AM
part.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
-- do your stuff
end
end)


Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
13 Apr 2017 09:36 AM
If it's a server sided script, you can use a for loop to loop through all the players and fire code to the player that is inside the for loop.

else just use LocalPlayer
Report Abuse
causati0n is not online. causati0n
Joined: 27 Mar 2012
Total Posts: 235
13 Apr 2017 09:36 AM
arena = game.Workspace.PVP

arena.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
player.CanDamage = true
end
end)
arena.TouchEnded:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
player.CanDamage = true
end
end)

Report Abuse
causati0n is not online. causati0n
Joined: 27 Mar 2012
Total Posts: 235
13 Apr 2017 09:37 AM
wrath you're too fast
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
13 Apr 2017 09:37 AM
Also wrath's code is better.
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
13 Apr 2017 09:37 AM
Welp you got ninja'd

xd
Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
13 Apr 2017 09:39 AM
ninja'd :D

our code is pretty much the same, the difference is he did op's work for him and i just showed op how to do it


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