|
| 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
|
  |
| Joined: 08 Feb 2016 |
| Total Posts: 1604 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 24 Jun 2016 09:42 PM |
nope :( its like the script is not loading
r+//My/Groups.aspx?gid=2851343 |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 24 Jun 2016 09:49 PM |
Ughh, I fixed it. I hate end values.
r+//My/Groups.aspx?gid=2851343 |
|
|
| Report Abuse |
|
|