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 
Dad_Bot is not online. Dad_Bot
Joined: 27 Jun 2011
Total Posts: 917
21 Jul 2017 11:24 AM
Is it possible to make a script that changes the click distance value of every click detector in the game when the game loads?


Report Abuse
Dad_Bot is not online. Dad_Bot
Joined: 27 Jun 2011
Total Posts: 917
21 Jul 2017 11:28 AM
b


Report Abuse
engeryman567 is not online. engeryman567
Joined: 05 Jun 2011
Total Posts: 52
21 Jul 2017 11:37 AM
Yes, don't know why you would need to do this though, you can set it manually, in a ClickDetector there is a property called MaxActivationDistance and you can set this
to change the click distance value.
Report Abuse
Dad_Bot is not online. Dad_Bot
Joined: 27 Jun 2011
Total Posts: 917
21 Jul 2017 11:38 AM
yeah but i have a lot of click detectors that i want to change to the same distance


Report Abuse
marfit is online. marfit
Joined: 10 Jan 2013
Total Posts: 2539
21 Jul 2017 11:40 AM
If all the click detectors share a common parent, IE: are all in a part within a group, then yes. You just use a for i,v in pairs(model:GetChildren()) "v" are the parts, so you would continue with if v.ClassName == part then
after this, v.ClickDetector.MaxActivationDistance = (number)
Report Abuse
Dad_Bot is not online. Dad_Bot
Joined: 27 Jun 2011
Total Posts: 917
21 Jul 2017 11:43 AM
any possible way if they do not have the same parent?


Report Abuse
caca50 is not online. caca50
Joined: 10 Jul 2011
Total Posts: 2037
21 Jul 2017 11:45 AM
copy and paste this into the command line:

local function findClick(x)
for i,v in pairs(x:GetChildren())do
if v:IsA'ClickDetector'then
v.MaxActivationDistance = 30
end
if #v:GetChildren()>0 then
findClick(v)
end
end
end
findClick(workspace)

Change the 30 into whatever number you want.


Roblox.Forum.Scripters:1: bad argument #1 to 'intellect' (number expected, got nil)
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