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
 

Please help :( it only works once without debounce.

Previous Thread :: Next Thread 
topraksu is not online. topraksu
Joined: 18 Jun 2009
Total Posts: 17
28 Sep 2014 04:21 AM
I made a gui for my game. You are crafting a bow and then equipping or unequipping it.

local Player = game.Players.LocalPlayer
local Crafted = false
local Equipped = false

script.Parent.MouseButton1Click:connect(function()
if Crafted == false then
if Player.Stats.Wood.Value >= 5 then
Player.Stats.Wood.Value = Player.Stats.Wood.Value - 5
script.Parent.Craftd.Visible = true
Crafted = true
end
elseif Crafted == true and Equipped == false and script.Parent.Parent.Equipd.Value == 0 then
script.Parent.Parent.Equipd.Value = 1
e = script.Parent.Weapon:Clone()
e.Parent = Player.Backpack
Equipped = true
script.Parent.BackgroundColor3 = Color3.new(0, 255, 0)
elseif Crafted == true and Equipped == true and script.Parent.Parent.Equipd.Value == 1 then
script.Parent.Parent.Equipd.Value = 0
script.Parent.BackgroundColor3 = Color3.new(255, 255, 255)
Player.Backpack.Weapon:remove()
end
end)

it only works once so you cant equip or unequip it again :( please help.
Report Abuse
Roblok1 is not online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
28 Sep 2014 04:28 AM
U need to set the denounces back to false sooner or later.
Report Abuse
Roblok1 is not online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
28 Sep 2014 04:29 AM
meant to say debounces
Report Abuse
topraksu is not online. topraksu
Joined: 18 Jun 2009
Total Posts: 17
28 Sep 2014 04:39 AM
thank you now i have got an idea :D
Report Abuse
topraksu is not online. topraksu
Joined: 18 Jun 2009
Total Posts: 17
28 Sep 2014 04:44 AM
its not working because if Crafted == false then cant work while crafting = true :D
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