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
 

Script Help.

Previous Thread :: Next Thread 
RinYamato is not online. RinYamato
Joined: 11 Aug 2013
Total Posts: 48
31 Aug 2014 10:16 PM
So I made this script for a gui shop, but it won't handle weapons with a space like for example: Golden Katana won't work but GoldenKatana will.
How do I make it so that it can work with a space in the name of the tool?


Cash = script.Parent.Parent.Parent.Parent.Parent.IntValue.Gold

function onClick()
if Cash.Value >= 1 then
Cash.Value = Cash.Value - 1
local Noobz = game.Lighting.Toolname:clone()
Noobz.Parent = script.Parent.Parent.Parent.Parent.Parent.StarterGear
local Noobz = game.Lighting.Toolname:clone()
Noobz.Parent = script.Parent.Parent.Parent.Parent.Parent.Backpack
Noobz.Handle.Anchored = false
end
end

script.Parent.MouseButton1Click:connect(onClick)
Report Abuse
Subete is not online. Subete
Joined: 10 Jul 2011
Total Posts: 917
31 Aug 2014 10:17 PM
use [' ']


ie ['Golden Katana']
Report Abuse
RinYamato is not online. RinYamato
Joined: 11 Aug 2013
Total Posts: 48
31 Aug 2014 10:20 PM
It didn't work, error lines are showing up.
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
31 Aug 2014 10:22 PM
local Noobz = game.Lighting['Tool name']:clone()
Report Abuse
RinYamato is not online. RinYamato
Joined: 11 Aug 2013
Total Posts: 48
31 Aug 2014 10:24 PM
Line 6 shows error when you add ['']
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
31 Aug 2014 10:27 PM
what's the error?
Report Abuse
RinYamato is not online. RinYamato
Joined: 11 Aug 2013
Total Posts: 48
31 Aug 2014 10:29 PM
I mean line 6 has the red error line when you add the [' ']
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
31 Aug 2014 10:30 PM
scroll over the line with error and tell me what it says
Report Abuse
RinYamato is not online. RinYamato
Joined: 11 Aug 2013
Total Posts: 48
31 Aug 2014 10:34 PM

Line 6: local Noobz = game.Lighting.['Golden Katana']:clone()

20:31:57.291 - Script 'Players.Player1.PlayerGui.ShopGui.Shop.3.BuyScript', Line 6
20:31:57.293 - Stack End
Report Abuse
Bobobob12 is not online. Bobobob12
Joined: 23 Jan 2008
Total Posts: 5350
31 Aug 2014 10:36 PM
local Noobz = game.Lighting['Golden Katana']:clone()

not

local Noobz = game.Lighting.['Golden Katana']:clone()
Report Abuse
RinYamato is not online. RinYamato
Joined: 11 Aug 2013
Total Posts: 48
31 Aug 2014 10:38 PM
@Above, looks the same to me.
Report Abuse
Bobobob12 is not online. Bobobob12
Joined: 23 Jan 2008
Total Posts: 5350
31 Aug 2014 10:38 PM
then you have a problem
Report Abuse
RinYamato is not online. RinYamato
Joined: 11 Aug 2013
Total Posts: 48
31 Aug 2014 10:39 PM
Oh wait I see.
Report Abuse
RinYamato is not online. RinYamato
Joined: 11 Aug 2013
Total Posts: 48
31 Aug 2014 10:40 PM
Thank you. Thread closed.
Report Abuse
RinYamato is not online. RinYamato
Joined: 11 Aug 2013
Total Posts: 48
31 Aug 2014 10:41 PM
Oh wait Bob can you hint me on how to make it so that the player cannot purchase it twice?
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