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: Is This Possible?

Previous Thread :: Next Thread 
SamTheDeveloper is not online. SamTheDeveloper
Joined: 16 Sep 2014
Total Posts: 194
07 Jan 2015 12:51 PM
Can You Have A Script That Checks If Anyone Is Touching A Brick? And What Would The Script Be?
Report Abuse
TeddyBauer is not online. TeddyBauer
Joined: 24 Jul 2014
Total Posts: 224
07 Jan 2015 12:54 PM
inside a brick place a script,

local Par=script.Parent

Par.Touched:connect(function(p)
if game.Players:FindFirstChild(p.Parent.Name)~=nil and Par:FindFirstChild(p.Parent.Name)==nil then
local val=Instance.new('BoolValue',Par)
val.name=p.Parent.Name
val.Value=true
end
end)
Par.TouchedEnded:connect(function(p)
if game.Players:FindFirstChild(p.Parent.Name)~=nil and Par:FindFirstChild(p.Parent.Name)~=nil then
Par:FindFirstChild(p.Parent.Name):Destroy()
end
end)

now from another script, to check if you are touching you can say:

if part:FindFirstChild(Player.Name)~=nil then
touching=true
else
touching=false
end
Report Abuse
SamTheDeveloper is not online. SamTheDeveloper
Joined: 16 Sep 2014
Total Posts: 194
07 Jan 2015 12:55 PM
So Which Script Do I Use?
Report Abuse
TheMinecraftRules is not online. TheMinecraftRules
Joined: 15 Aug 2013
Total Posts: 878
07 Jan 2015 12:57 PM
game.Workspace.Part.Touched(function(p)
print(p.."is touching the brick")
game.Workspace.Part.TouchEnded(function()
print(p.."has topped touching")
end)
end)

Try it!May not work!
Report Abuse
affectless is not online. affectless
Joined: 28 Dec 2014
Total Posts: 1084
07 Jan 2015 12:58 PM
You're a developer, what do you need these guys' help for?
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
07 Jan 2015 12:58 PM
@teddy

game.Players:GetPlayerFromCharacter(hit.Parent)
Report Abuse
TeddyBauer is not online. TeddyBauer
Joined: 24 Jul 2014
Total Posts: 224
07 Jan 2015 01:02 PM
@chimmihc, I almost never use that method, by habit. But thanks for pointing that out.
Report Abuse
SamTheDeveloper is not online. SamTheDeveloper
Joined: 16 Sep 2014
Total Posts: 194
07 Jan 2015 01:23 PM
Thanks And All But Does It Constantly Check If Sombody Is Touching It Or What Because.

I Want It To Constantly Check if The Part Is Being Touched And As Soon As Nobody Is Walking On It The BrickColor Changes To("Really red")
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
07 Jan 2015 01:26 PM
I would love to help you but when I pressed the reply button I realized that your method of writing really annoys me
Report Abuse
MrNoobe123 is not online. MrNoobe123
Joined: 14 Nov 2014
Total Posts: 153
07 Jan 2015 01:37 PM
"SamTheDeveloper" Doesnt know how to make an touched function... Ya... Im not helping.

Lrn 2 cod lua m8
Report Abuse
TeddyBauer is not online. TeddyBauer
Joined: 24 Jul 2014
Total Posts: 224
07 Jan 2015 02:22 PM
@MrNoobe123, He is learning to code, that is why he is here.

@Sam this autochecks as it is, Im sorry if you do not know how to use the code at hand.
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