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 » Scripters
Home Search
 

Re: Need help with script.

Previous Thread :: Next Thread 
TheExtinction is online. TheExtinction
Joined: 26 Aug 2013
Total Posts: 57
24 Jun 2016 09:27 PM
Why is this script not working?

--[[
Script by GHStudios
Version 1.0
GHStudios: https://www.roblox.com/My/Groups.aspx?gid=1111154
6/22/2016
--]]

print ('Button Script Loaded')

local price = script.Parent.Price.Value
local item = script.Parent.ItemToBuy.Value
local Name = script.Parent.Parent.Name

function onTouched(hit)
print ('Button Script Touch Event')
local check = hit.Parent:FindFirstChild("Humanoid")
if check ~= nil then
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
local stats = user:findFirstChild("leaderstats")
if stats ~= nil then
local cash = stats:findFirstChild("R$")
if cash.Value >= price then
local item = Game.ServerStorage.Bank_Tycoon.TD_Bank.ItemsToBuy:FindFirstChild(item):clone()
item.Parent = game.Workspace.Bank_Tycoon.TD_Bank.Bought
print ('Item Bought')
Name = ('Bought!, Please wait while item is built!')
wait (0.1)
script.Parent.Transparency = 0, -0.1, 0.1, -0.1, -0.1, -0.1, -0.1, -0.1, -0.1, -0.1, -0.1
script.Parent.Parent:Destroy()
else if cash.Value ~= price then
Name = ('Not Enough $R, Please get more!')
Wait (5)
Name = ('Buy')
print ('Dont have enough cash!')
end
end
end
end

script.Parent.Touched:connect(onTouched)




r+//My/Groups.aspx?gid=2851343
Report Abuse
Lem0nzzx is not online. Lem0nzzx
Joined: 08 Feb 2016
Total Posts: 1604
24 Jun 2016 09:30 PM
Output?
Report Abuse
TheExtinction is online. TheExtinction
Joined: 26 Aug 2013
Total Posts: 57
24 Jun 2016 09:36 PM
Nothing, Not even the first print showing its loaded shows up. The script is not disabled.


r+//My/Groups.aspx?gid=2851343
Report Abuse
Lem0nzzx is not online. Lem0nzzx
Joined: 08 Feb 2016
Total Posts: 1604
24 Jun 2016 09:38 PM
--[[
Script by GHStudios
Version 1.0
GHStudios: https://www.roblox.com/My/Groups.aspx?gid=1111154
6/22/2016
]]--

I don't know if that doesn't fix your problem.
Report Abuse
TheExtinction is online. TheExtinction
Joined: 26 Aug 2013
Total Posts: 57
24 Jun 2016 09:42 PM
nope :( its like the script is not loading


r+//My/Groups.aspx?gid=2851343
Report Abuse
Lem0nzzx is not online. Lem0nzzx
Joined: 08 Feb 2016
Total Posts: 1604
24 Jun 2016 09:44 PM
What kind of script is it, and where is it located?
By kind of script, is it local, or regular?
Report Abuse
TheExtinction is online. TheExtinction
Joined: 26 Aug 2013
Total Posts: 57
24 Jun 2016 09:45 PM
Reqular and the script started running after i put end after the dumb event.

script.Parent.Touched:connect(onTouched)
end

How does that need a end xD


r+//My/Groups.aspx?gid=2851343
Report Abuse
TheExtinction is online. TheExtinction
Joined: 26 Aug 2013
Total Posts: 57
24 Jun 2016 09:46 PM
The Original script i modified

print ('Enjoy your $Rs')

function onTouched(hit)
local check = hit.Parent:FindFirstChild("Humanoid") --Find the human that touched the button
if check ~= nil then --If a human is found, then
local user = game.Players:GetPlayerFromCharacter(hit.Parent) --get player from touching human
local stats = user:findFirstChild("leaderstats") --Find moneyholder
if stats ~= nil then --If moneyholder exists then
local cash = stats:findFirstChild("R$") --Get money
cash.Value = cash.Value +1 --increase amount of money by the number displayed here (500)
wait(0.1) --wait-time before button works again
script.Parent:Destroy()
end
end
end

script.Parent.Touched:connect(onTouched)



r+//My/Groups.aspx?gid=2851343
Report Abuse
TheExtinction is online. TheExtinction
Joined: 26 Aug 2013
Total Posts: 57
24 Jun 2016 09:49 PM
Ughh, I fixed it. I hate end values.


r+//My/Groups.aspx?gid=2851343
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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