#Make script work on more stuff other than a single thing idk how to explain
106 messages · Page 1 of 1 (latest)
lol
Yes
okay
how do i do this..
kinda need help
Is there a ProximityPrompt in every model?
i made the script ik it looks messy ash
in the model yes
I see the issue
Alright
I want you to make a folder in workspace
name it Atm(s)
Please place all atms into it
you can see in the script "ATMS" and
ye
thats the folder
Yup one sec
This should work```lua
local Atms = game:GetService("Workspace"):WaitForChild("ATMS") -- Getting atms
local GearAccess = game:GetService("Players").Localplayer:WaitForChild("Backpack")
local function AtmsToggle(Action:Boolean)
if Action == true then
for i, atm in ipairs(Atms:GetChildern) do -- Gets all the ATMs
atm.RobPart.ProximityPrompt.Enabled = true
end
else
for i, atm in ipairs(Atms:GetChildern) do -- Gets all the ATMs
atm.RobPart.ProximityPrompt.Enabled = false
end
end
end
-- Call the function
GearAccess.AKMN.Equipped:Connect(function()
AtmsToggle(true)
end
GearAccess.AKMN.Unequipped:Connect(function()
AtmsToggle(true)
end
sure
Ok 1 sec
wait
I see the bug
local Atms = game:GetService("Workspace"):WaitForChild("ATMS") -- Getting atms
local GearAccess = game:GetService("Players").Localplayer:WaitForChild("Backpack")
Fixed```lua
local function AtmsToggle(Action:Boolean)
if Action == true then
for i, atm in ipairs(Atms:GetChildern()) do -- Gets all the ATMs
atm.RobPart.ProximityPrompt.Enabled = true
end
else
for i, atm in ipairs(Atms:GetChildern()) do -- Gets all the ATMs
atm.RobPart.ProximityPrompt.Enabled = false
end
end
end
-- Call the function
GearAccess.AKMN.Equipped:Connect(function()
AtmsToggle(true)
end
GearAccess.AKMN.Unequipped:Connect(function()
AtmsToggle(true)
end```
Ok
lemme try that
Roblox is a global platform that brings people together through play.
does not work
Got it working
local Atms = game:GetService("Workspace"):WaitForChild("ATMS") -- Getting atms
local function AtmsToggle(Action)
if Action == true then
for i, atm in ipairs(Atms:GetChildren()) do -- Gets all the ATMs
atm.RobPart.ProximityPrompt.Enabled = true
end
else
for i, atm in ipairs(Atms:GetChildren()) do -- Gets all the ATMs
atm.RobPart.ProximityPrompt.Enabled = false
end
end
end
-- Call the function
script.Parent.Equipped:Connect(function()
AtmsToggle(true)
end)
script.Parent.Unequipped:Connect(function()
AtmsToggle(true)
end)
Can I see your script?
** You are now Level 4! **
I forgot to change one small thing this should work ```lua
local Atms = game:GetService("Workspace"):WaitForChild("ATMS") -- Getting atms
local function AtmsToggle(Action)
if Action == true then
for i, atm in ipairs(Atms:GetChildren()) do -- Gets all the ATMs
atm.RobPart.ProximityPrompt.Enabled = true
end
else
for i, atm in ipairs(Atms:GetChildren()) do -- Gets all the ATMs
atm.RobPart.ProximityPrompt.Enabled = false
end
end
end
-- Call the function
script.Parent.Equipped:Connect(function()
AtmsToggle(true)
end)
script.Parent.Unequipped:Connect(function()
AtmsToggle(false)
end)
Hm
maybe use this script but make it find more ATM's
okay
@zinc merlin u there?
yeah
okay
did u finish it?
I don't know why the last script isn't working try restarting studio?
Ask in #👷︱for-hire
Wait
not ask hire someone
ask in #📜︱scripting
How do I make a script that when I equipped a tool it enable a proximity prompt of items in a folder?
thx
this is not what i mean
I mean like
How do i make it so when i duplicate the items into more the proximity will enable not just one item
proximity will enable all of them?
yes
I see
it already works when I equipped a tool it enable a proximity prompt but only works in 1 item but when i duplicate it doesnt work for the others
only 1 item
I found the bug! this should work```lua
local Atms = game:GetService("Workspace"):WaitForChild("ATMS") -- Getting atms
local function AtmsToggle(Action)
if Action == true then
for i, atm in ipairs(Atms:GetChildren()) do -- Gets all the ATMs
atm.RobPart.ProximityPrompt.Enabled = true
end
else
for i, atm in ipairs(Atms:GetChildren()) do -- Gets all the ATMs
atm.RobPart.ProximityPrompt.Enabled = false
end
end
end)
-- Call the function
script.Parent.Equipped:Connect(function()
AtmsToggle(true)
end)
script.Parent.Unequipped:Connect(function()
AtmsToggle(false)
end)
okay
i think you forgot to locate the name of the tool
Nope if the script is in the tool it should work
okay
** You are now Level 5! **
local Atms = game:GetService("Workspace"):WaitForChild("ATMS") -- Getting atms
local function AtmsToggle(Action)
for _,atm in Atms:GetChildren() do -- Gets all the ATMs
atm.RobPart.ProximityPrompt.Enabled = Action
end
end)
-- Call the function
script.Parent.Equipped:Connect(function()
AtmsToggle(true)
end)
script.Parent.Unequipped:Connect(function()
AtmsToggle(false)
end)
wayyy cleaner way to do it
you dont have to code nest
and using ipairs is slow, just make it check for children
this dont work
ughhhhh how do i make this work
You're probably not locating the script properly.
can i send u the model and show u?
its been 2 days im trying to figure this out