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: Why won't this work?

Previous Thread :: Next Thread 
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Feb 2014 08:01 PM
if script.Parent.Text == "Part" then
Instance.new("Part", Workspace)
end
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Feb 2014 08:04 PM
bump
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Feb 2014 08:08 PM
please?
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
06 Feb 2014 08:11 PM
Is that the whole script?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
06 Feb 2014 08:11 PM
what is the script's parent
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Feb 2014 08:13 PM
textbox
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
06 Feb 2014 08:14 PM
if this is the entire script then when the game loads it checks and it it won't load again
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
06 Feb 2014 08:14 PM
function c()
if script.Parent.Text == "Part" then
Instance.new("Part", Workspace)
end

script.Parent.Changed:connect(c)

--would work if youre changing the text later on and it doesnt start of with the text "Part"
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
06 Feb 2014 08:15 PM
You want to create a part every time it changes to Part?
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Feb 2014 08:16 PM
@cnt

yes
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Feb 2014 08:17 PM
@extreme

the last line is wrong
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
06 Feb 2014 08:18 PM
This is probably the best way so it doesn't spam parts, only creates it one you click enter.

local self = script.Parent
local function lostFocus(e)
if e and self.Text == "Part" then
Instance.new("Part", workspace)
end
end
self.FocusLost:connect(lostFocus)
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
06 Feb 2014 08:19 PM
^ Whats FocusLost?
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
06 Feb 2014 08:21 PM
when you stop typing in a textbox by pressing enter or clicking outside of it. if you pressed enter, it's argument (enterPressed) is true
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Feb 2014 08:22 PM
@cnt

thanks lemme try it
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Feb 2014 08:24 PM
@cnt

Thank you!!!!!!!!! But can you help me get the part to spawn on my head?
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
06 Feb 2014 08:25 PM
local self = script.Parent
local function lostFocus(e)
if e and self.Text == "Part" then
Instance.new("Part", workspace).Position = game.Players.LocalPlayer.Character.Head.Position + Vector3.new(0,1.1,0)
end
end
self.FocusLost:connect(lostFocus)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
06 Feb 2014 08:26 PM
local part = Instance.new("Part")
part.Anchored = true --I'm assuming you want it anchored
part.Position = script.Parent.Parent.Parent.Character.Head.Position + Vector3.new(0, script.Parent.Parent.Parent.Character.Head.Size.Y/2, 0)
part.Parent = workspace
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Feb 2014 08:27 PM
Thanks!!! But is Vector3.new finished?? :P
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Feb 2014 08:28 PM
Thank you so much and i have one more question. Where do i put;

local part = Instance.new("Part")
part.Anchored = true --I'm assuming you want it anchored
part.Position = script.Parent.Parent.Parent.Character.Head.Position + Vector3.new(0, script.Parent.Parent.Parent.Character.Head.Size.Y/2, 0)
part.Parent = workspace

--where toi paste this?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
06 Feb 2014 08:28 PM
lolb, I'm assuming he is using a server-side script in a button under a gui in playergui. since this new FilteringEnabled thing might screw with this, I'm not sure of the details of it
Report Abuse
yankeejr is not online. yankeejr
Joined: 04 Jul 2012
Total Posts: 4906
06 Feb 2014 08:30 PM
where do i paste it
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
06 Feb 2014 08:31 PM
same place you did the Instance.new("Part", workspace), just remove that line and paste it there
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
06 Feb 2014 08:32 PM
FittingEnabled?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
06 Feb 2014 08:33 PM
No, re-read what I said... "FilteringEnabled"
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