of     1   

tarrdo
#141202838Tuesday, July 22, 2014 9:50 PM GMT

So there is a script to do Distance From Character but I dont know how to use it. I would like to be able to learn how to script it so I can script distance from character to NPC to open a shop.
InternetGuy
#141203088Tuesday, July 22, 2014 9:52 PM GMT

I'm on an iPad so excuse any errors. local dist = 5 while wait() do If (part1.Position - part2.Position).magnitude <= dist then print'within range' end
InternetGuy
#141203162Tuesday, July 22, 2014 9:53 PM GMT

Whoops local dist = 5 while wait() do If (part1.Position - part2.Position).magnitude <= dist then print'within range' end end
cntkillme
#141205213Tuesday, July 22, 2014 10:12 PM GMT

Or if you are comparing a character to a position, you could do if player:DistanceFromCharacter(part.Position) <= dist then as opposed to subtracting the Torso.Position and part.Position and using the Magnitude member
tarrdo
#141209273Tuesday, July 22, 2014 10:54 PM GMT

local dist = 5 while wait() do If (character.Position - BlackSmith.Torso.5.82,4.1,-26.682).magnitude then script.Parent.Parent.Parent.StarterGui:findFirstChild("PrimaryShop") game.StarterGui.ScreenGui.PrimaryShop.Visible = True end end Would this work?
cntkillme
#141209645Tuesday, July 22, 2014 10:57 PM GMT

No. Character is undefined, BlackSmith is undefined, incorrect conditional syntax, True should be true.
tarrdo
#141213613Tuesday, July 22, 2014 11:36 PM GMT

local dist = 5 while wait() do If (character.Position - BlackSmith.5.82,4.1,-26.682).magnitude then script.Parent.Parent.Parent.StarterGui:findFirstChild("PrimaryShop") game.StarterGui.ScreenGui.PrimaryShop.Visible = true else game.StarterGui.ScreenGui.PrimaryShop.Visible = false end end My-primaryshop-visible-is-off-and-I-want-it-only-to-be-visble-when-near-blacksmith-else-false. -- sorry-bout-this-roblox-keeps-saying-theres-an-innapropriate-word-in-this
tarrdo
#141216296Wednesday, July 23, 2014 12:05 AM GMT

I can't post the part thats important that says what character is and BlackSmith apparently it has swears in it and no matter how many dashes or commas or periods I put in it its still a swear
128GB
#141216361Wednesday, July 23, 2014 12:06 AM GMT

pastebin or twitter pls
tarrdo
#141217813Wednesday, July 23, 2014 12:21 AM GMT

https://twitter.com/MikeATCerqueira/status/491739797908500480
128GB
#141218063Wednesday, July 23, 2014 12:24 AM GMT

Why are you using == and not =? And why are you setting a variable to a PlayerAdded event? Also local Blacksmith = Workspace["Black/Smith"]
tarrdo
#141221665Wednesday, July 23, 2014 1:03 AM GMT

what did you put it as black/smith?
tarrdo
#141224825Wednesday, July 23, 2014 1:37 AM GMT

ignore that I forgot to remove that / from it :P
tarrdo
#141229836Wednesday, July 23, 2014 2:27 AM GMT

I don't know how to link character otherwise thats why I used playerAdded
tarrdo
#141232958Wednesday, July 23, 2014 3:00 AM GMT

bump
tarrdo
#141273637Wednesday, July 23, 2014 2:20 PM GMT

bump
tarrdo
#141336637Thursday, July 24, 2014 1:56 AM GMT

bump

    of     1