generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Help with StringValues

Previous Thread :: Next Thread 
pio22raqr7 is not online. pio22raqr7
Joined: 11 Jul 2012
Total Posts: 420
19 Mar 2014 12:49 PM
So I'm trying to make it like Find the StringValue with the value of something, how would I do that? This is what I got:

found = game.Workspace:FindFirstChild("StringValue")
--Im not sure...
Report Abuse
pio22raqr7 is not online. pio22raqr7
Joined: 11 Jul 2012
Total Posts: 420
19 Mar 2014 12:52 PM
bump umbrella
Report Abuse
idyllically is not online. idyllically
Joined: 13 Mar 2010
Total Posts: 4622
19 Mar 2014 12:55 PM
for _, v in pairs(game.Workspace:GetChildren()) do
if v.ClassName == "StringValue" then
if v.Text = "Put the text from the string you want to find within these quotes" then
print(v.Name)
end
end
end

All it does is print the name of the string you're looking for.

Outfoxing Foxes
Report Abuse
pio22raqr7 is not online. pio22raqr7
Joined: 11 Jul 2012
Total Posts: 420
19 Mar 2014 01:12 PM
Thank you.
Report Abuse
pio22raqr7 is not online. pio22raqr7
Joined: 11 Jul 2012
Total Posts: 420
19 Mar 2014 01:16 PM
Well now how would I add it to this script:
local tool = script.Parent
local user
tool.Equipped:connect(function(mouse)
user = tool.Parent
mouse.Button1Down:connect(function()
local ray = Ray.new(tool.Handle.CFrame.p, (mouse.Hit.p - tool.Handle.CFrame.p).unit*300)
local hit, position = game.Workspace:FindPartOnRay(ray, user)
local humanoid = hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid:AddTo(tool)
end
local distance = (position - tool.Handle.CFrame.p).magnitude
local rayPart = Instance.new("Part", user)
rayPart.Name = "RayPart"
rayPart.BrickColor = BrickColor.new("Bright red")
rayPart.Transparency = 0.5
rayPart.Anchored = true
rayPart.CanCollide = false
rayPart.TopSurface = Enum.SurfaceType.Smooth
rayPart.BottomSurface = Enum.SurfaceType.Smooth
rayPart.formFactor = Enum.FormFactor.Custom
rayPart.Size = Vector3.new(0.2, 0.2, distance)
rayPart.CFrame = CFrame.new(position, tool.Handle.CFrame.p) * CFrame.new(0, 0, -distance/2)

game.Debris:AddItem(rayPart, 0.1)
end)
end)
Report Abuse
idyllically is not online. idyllically
Joined: 13 Mar 2010
Total Posts: 4622
19 Mar 2014 01:23 PM
I don't know why you would have to find a stringvalue for a raycasting thing.

Outfoxing Foxes
Report Abuse
pio22raqr7 is not online. pio22raqr7
Joined: 11 Jul 2012
Total Posts: 420
19 Mar 2014 01:24 PM
I'm making a Pokemon game :/
Report Abuse
pio22raqr7 is not online. pio22raqr7
Joined: 11 Jul 2012
Total Posts: 420
19 Mar 2014 01:44 PM
bump.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image