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
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 917 |
|
| |
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|