of     1   

DesignerDavid
#228084706Sunday, November 26, 2017 3:11 PM GMT

HOW THE SCRIPT WORKS: The button is based on magnitude, giving the illusion that when the Player is on the Button, they are triggering the buttons. This works for only one person. Multiple Players, however... no. SITUATION/PROBLEM: When it was just me in the server, they were working fine. But when a friend of mine joined, I lost all access of triggering the Buttons. But the interesting part is that my friend was able to trigger the Buttons, and I was not. Once he left the server, I was given back the power of triggering the Buttons. I want the Buttons to be able to support Multiple players on the same server, triggering Buttons. PLACE: https://www.roblox.com/games/952310433/Button-Testing (Must have a friend or someone to see this happen! I might be in the server.) CODE: while true do for i, v in pairs(game.Players:GetChildren()) do if (v.Character.Torso.Position - script.Parent.Position).magnitude <= 3.7 then script.Parent.BrickColor = BrickColor.new("Grime") script.Parent.Parent.Partb.CanCollide = true script.Parent.Parent.Partb.Transparency = 0 elseif (v.Character.Torso.Position - script.Parent.Position).magnitude >= 3.7 then script.Parent.BrickColor = BrickColor.new("Medium green") script.Parent.Parent.Partb.CanCollide = false script.Parent.Parent.Partb.Transparency = 1 end end wait() end
DesignerDavid
#228091548Sunday, November 26, 2017 5:08 PM GMT

Bump!
Vulkarin
#228092285Sunday, November 26, 2017 5:17 PM GMT

I would make some bools to make sure one player isn't effecting another player ontop of the button...my guess is that your player was infront of his and thus he was the only one who seemingly affected the button because the script ran on him second pressed = false while true do for _,v in pairs(players) do if not pressed and tiny magnitude then pressed = true elseif not pressed and big magnitude then return end end if pressed then do stuff to brick here else do some other stuff to birck end wait(sometime) end
DesignerDavid
#228092612Sunday, November 26, 2017 5:21 PM GMT

how do i define the player with that code?
DesignerDavid
#228093181Sunday, November 26, 2017 5:28 PM GMT

Well, now nothing has happened: while true do for _,v in pairs(game.Players:GetChildren()) do if not pressed and (v.Character.Torso.Position - script.Parent.Position).magnitude <=3.7 then pressed = true elseif not pressed and (v.Character.Torso.Position - script.Parent.Position).magnitude >=3.7 then return end end if pressed then script.Parent.BrickColor = BrickColor.new("Grime") script.Parent.Parent.Partc.CanCollide = true script.Parent.Parent.Partc.Transparency = 0 else script.Parent.BrickColor = BrickColor.new("Medium green") script.Parent.Parent.Partc.CanCollide = false script.Parent.Parent.Partc.Transparency = 1 end wait() end i'm wondering why.
Vulkarin
#228093782Sunday, November 26, 2017 5:35 PM GMT

ah okay my bad of you remove the return then it works
DesignerDavid
#228130071Monday, November 27, 2017 2:38 AM GMT

bump
Vulkarin
#228130161Monday, November 27, 2017 2:40 AM GMT

why???
DesignerDavid
#228130217Monday, November 27, 2017 2:41 AM GMT

the original codel i have posted is still not fixed.
Vulkarin
#228130273Monday, November 27, 2017 2:42 AM GMT

If you remove the return it works like I said earlier..
DesignerDavid
#228130458Monday, November 27, 2017 2:46 AM GMT

by return, are you talking about the 'if' statements with keypressed variable
Vulkarin
#228130501Monday, November 27, 2017 2:47 AM GMT

The only return in the script
DesignerDavid
#228130902Monday, November 27, 2017 2:54 AM GMT

I just noticed the return part lol thanks. But now it only works halfway. It only gives the illusion that the player is triggering the button, but when the player steps off, the color doesn't revert back to its original color. while true do for _,v in pairs(game.Players:GetChildren()) do if not pressed and (v.Character.Torso.Position - script.Parent.Position).magnitude <=3.7 then pressed = true elseif not pressed and (v.Character.Torso.Position - script.Parent.Position).magnitude >3.7 then pressed = false end end if pressed == true then script.Parent.BrickColor = BrickColor.new("Grime") script.Parent.Parent.Partc.CanCollide = true script.Parent.Parent.Partc.Transparency = 0 elseif pressed == false then script.Parent.BrickColor = BrickColor.new("Medium green") script.Parent.Parent.Partc.CanCollide = false script.Parent.Parent.Partc.Transparency = 1 end wait() end
Vulkarin
#228130954Monday, November 27, 2017 2:55 AM GMT

while true do pressed = false
DesignerDavid
#228131203Monday, November 27, 2017 2:59 AM GMT

could you visit this place real quick: https://www.roblox.com/games/952310433/Button-Testing
balcktack
#228131412Monday, November 27, 2017 3:03 AM GMT

whats your friends name? THIS IS A RELEVANT QUESTION!

    of     1