of     1   

ninjaguy77777
#228382515Sunday, December 03, 2017 3:55 PM GMT

fe is enabled, no errors local bin = game.Workspace.Bin.Bin game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(char) char.Torso.Changed:connect(function() if (bin.Position - char.Torso.Position).magnitude > 20 then plr.test.Value = false for i,v in pairs(plr.PlayerGui:GetChildren()) do if v.Name == "ClearGui" then v:Destroy() end end end end) end) end) gui supposed to close after being 20 studs away from this part
ninjaguy77777
#228382630Sunday, December 03, 2017 3:57 PM GMT

b
Denny9876
#228382847Sunday, December 03, 2017 4:01 PM GMT

Are you using R15 or R6? If you're using R15, change char.Torso into char.HumanoidRootPart. If that doesn't work, I don't know. I'm looking through the script to see if anything else is wrong.
ninjaguy77777
#228382872Sunday, December 03, 2017 4:02 PM GMT

r6
eRanged
#228383074Sunday, December 03, 2017 4:05 PM GMT

use a remote, u cant see inside PlayerGui with FE
Denny9876
#228383103Sunday, December 03, 2017 4:06 PM GMT

Is this a localscript or a script? If it's a script, I don't think it works because GUI can only be used by localscripts since FE is enabled. You'll probably have to use some RemoteEvent stuff. 1 server script which handles when the player gets 20 studs away, and a localscript in StarterGui that does the GUI stuff. Here's the link to RemoteEvents if you need to learn more about it : http://wiki.roblox.com/index.php?title=API:Class/RemoteEvent
ninjaguy77777
#228383731Sunday, December 03, 2017 4:19 PM GMT

did i do anyhting wrong (doesnt work) -- script local bin = game.Workspace.Bin.Bin game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(char) char.Torso.Changed:connect(function() if plr.test.Value == true then if (bin.Position - char.Torso.Position).magnitude > 20 then game.ReplicatedStorage:WaitForChild("Destroy"):FireClient(plr) end end end) end) end) -- Localscript local plr = game.Players.LocalPlayer function change() for i,v in pairs(plr.PlayerGui:GetChildren()) do if v.Name == "ClearGui" then v:Destroy() end plr.test.Value = false end end game.ReplicatedStorage:WaitForChild("Destroy").OnClientEvent:connect(change)
eRanged
#228383923Sunday, December 03, 2017 4:23 PM GMT

use prints to debug ur code and see where it stops
ninjaguy77777
#228384284Sunday, December 03, 2017 4:30 PM GMT

i have a high feeling it has to do with the magnitude or .changed but ill try what you said ^
ninjaguy77777
#228384850Sunday, December 03, 2017 4:41 PM GMT

no prints local bin = game.Workspace:WaitForChild("Bin").Bin game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(char) print('hello world1') char.Torso.Changed:connect(function() print('hello world2') if plr.test.Value == true then if (bin.Position - char.Torso.Position).magnitude > 20 then print('hello world3') game.ReplicatedStorage:WaitForChild("Destroy"):FireClient(plr) end end end) end) end)
ninjaguy77777
#228385240Sunday, December 03, 2017 4:48 PM GMT

b2
ninjaguy77777
#228385691Sunday, December 03, 2017 4:59 PM GMT

rippp
ninjaguy77777
#228385857Sunday, December 03, 2017 5:02 PM GMT

i was right magnitude and .changed are the problem
Denny9876
#228385877Sunday, December 03, 2017 5:03 PM GMT

Wait, are you saying it runs through all the way, or it didn't print anything at all? If it didn't print anything, it must be that WaitForChild that's stalling it.Make sure there's something named "Bin" in workspace. Also make sure there's nothing else in workspace named "Bin".
ninjaguy77777
#228385928Sunday, December 03, 2017 5:04 PM GMT

i put a print after bin afterwards and that worked and nothing after that worked
ninjaguy77777
#228386298Sunday, December 03, 2017 5:11 PM GMT

b4
Denny9876
#228386450Sunday, December 03, 2017 5:14 PM GMT

Put the bin line after char.Torso.Changed. I think if you use waitforchild before PlayerAdded, the player would have already joined because of waitforchild so game.Players.PlayerAdded won't fire.
ninjaguy77777
#228390144Sunday, December 03, 2017 6:28 PM GMT

works in test mode but not in real server rip
Denny9876
#228391375Sunday, December 03, 2017 6:52 PM GMT

Your script is using GUI stuff and i'm assuming this is a server script. You're probably going to have to use RemoteEvents to fix this one. :I
ninjaguy77777
#228391732Sunday, December 03, 2017 7:00 PM GMT

b5

    of     1