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
 

Keep tools script

Previous Thread :: Next Thread 
LordDestroyerChaos is not online. LordDestroyerChaos
Joined: 03 Jun 2012
Total Posts: 5742
16 Mar 2014 09:41 AM
Can you guys help me with a keep tools script? It's a script that keeps your tools when you die (The tools you bought from the shop). Thanks!

This is my shop script:

print("Shop Script Loaded")

Door = script.Parent
local debounce = false

function getPlayer(humanoid)
local players = game.Players:children()
for i = 1, #players do
if players[i].Character.Humanoid == humanoid then return players[i] end
end
return nil
end
function onTouched(hit)
if debounce == false then
local human = hit.Parent:findFirstChild("Humanoid")
if (human == nil) then return end
local player = getPlayer(human)
debounce = true
if (player == nil) then return end
local stats = player:findFirstChild("leaderstats")
local sp = stats:findFirstChild("Money")
if sp == nil then return false end
if (sp.Value >=0) then
sp.Value = sp.Value - 0
print("Enough Money")
game.Lighting.BambooKatana:clone().Parent = player.Backpack -- bamboo kat. is the wep it'll give you
Door.BrickColor = BrickColor.new(21)
wait(2)
Door.BrickColor = BrickColor.new(37)
debounce = false
else debounce = false
end
end

end

connection = Door.Touched:connect(onTouched)
Report Abuse
LordDestroyerChaos is not online. LordDestroyerChaos
Joined: 03 Jun 2012
Total Posts: 5742
16 Mar 2014 09:45 AM
Thank you so much guys! :)
Report Abuse
blueboy112 is not online. blueboy112
Joined: 15 Apr 2009
Total Posts: 802
16 Mar 2014 10:02 AM
Where you have:
game.Lighting.BambooKatana:clone().Parent = player.Backpack

Add
game.Lighting.BambooKatana:clone().Parent = player.Starterpack

So it looks like
game.Lighting.BambooKatana:clone().Parent = player.Backpack
game.Lighting.BambooKatana:clone().Parent = player.Starterpack

Anything in the Starterpack is given to a player when he/she respawns.
Report Abuse
LordDestroyerChaos is not online. LordDestroyerChaos
Joined: 03 Jun 2012
Total Posts: 5742
16 Mar 2014 10:07 AM
Thank you som much! Want RBX?
Report Abuse
blueboy112 is not online. blueboy112
Joined: 15 Apr 2009
Total Posts: 802
16 Mar 2014 10:11 AM
No thanks, I just like to help people.

Look, I do things now! http://www.roblox.com/Forum/ShowPost.aspx?PostID=128214378
Report Abuse
LordDestroyerChaos is not online. LordDestroyerChaos
Joined: 03 Jun 2012
Total Posts: 5742
16 Mar 2014 10:12 AM
So, print("Shop Script Loaded")

Door = script.Parent
local debounce = false

function getPlayer(humanoid)
local players = game.Players:children()
for i = 1, #players do
if players[i].Character.Humanoid == humanoid then return players[i] end
end
return nil
end
function onTouched(hit)
if debounce == false then
local human = hit.Parent:findFirstChild("Humanoid")
if (human == nil) then return end
local player = getPlayer(human)
debounce = true
if (player == nil) then return end
local stats = player:findFirstChild("leaderstats")
local sp = stats:findFirstChild("KOs")
if sp == nil then return false end
if (sp.Value >=2) then
sp.Value = sp.Value - 2
print("Enough Money")
game.Lighting.BambooKatana:clone().Parent = player.Backpack
game.Lighting.BambooKatana:clone().Parent = player.Starterpack
Door.BrickColor = BrickColor.new(21)
wait(2)
Door.BrickColor = BrickColor.new(37)
debounce = false
else debounce = false
end
end

end

connection = Door.Touched:connect(onTouched)
Report Abuse
LordDestroyerChaos is not online. LordDestroyerChaos
Joined: 03 Jun 2012
Total Posts: 5742
16 Mar 2014 10:14 AM
:D ya sure, you don't want R$. Also, can you add me maybe? I'm adding you to the credits of my game as a scripter :D. My game was on the front page before by the way!
Report Abuse
meSmashsta is not online. meSmashsta
Joined: 31 Jan 2013
Total Posts: 1002
16 Mar 2014 10:15 AM
lol i can't believe you think this is going to help you X)))) this'll make EVERYONE get the weapons LOL
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
16 Mar 2014 10:18 AM
@above
No actually it won't.
Report Abuse
LordDestroyerChaos is not online. LordDestroyerChaos
Joined: 03 Jun 2012
Total Posts: 5742
16 Mar 2014 10:18 AM
Let me test it.
Report Abuse
blueboy112 is not online. blueboy112
Joined: 15 Apr 2009
Total Posts: 802
16 Mar 2014 10:18 AM
Woops, realized I messed up, spelling error.
USE THIS INSTEAD:
(I changed Starterpack to StarterGear)

print("Shop Script Loaded")

Door = script.Parent
local debounce = false

function getPlayer(humanoid)
local players = game.Players:children()
for i = 1, #players do
if players[i].Character.Humanoid == humanoid then return players[i] end
end
return nil
end
function onTouched(hit)
if debounce == false then
local human = hit.Parent:findFirstChild("Humanoid")
if (human == nil) then return end
local player = getPlayer(human)
debounce = true
if (player == nil) then return end
local stats = player:findFirstChild("leaderstats")
local sp = stats:findFirstChild("Money")
if sp == nil then return false end
if (sp.Value >=0) then
sp.Value = sp.Value - 0
print("Enough Money")
game.Lighting.BambooKatana:clone().Parent = player.Backpack
game.Lighting.BambooKatana:clone().Parent = player.StarterGear
Door.BrickColor = BrickColor.new(21)
wait(2)
Door.BrickColor = BrickColor.new(37)
debounce = false
else debounce = false
end
end

end

connection = Door.Touched:connect(onTouched)

Look, I do things now! http://www.roblox.com/Forum/ShowPost.aspx?PostID=128214378
Report Abuse
blueboy112 is not online. blueboy112
Joined: 15 Apr 2009
Total Posts: 802
16 Mar 2014 10:19 AM
@meSmash

game.StarterPack is for all the players.

game.Players.Player1.StarterGear is just for that one player.
It's how roblox gives you the catalog Gear.

Look, I do things now! http://www.roblox.com/Forum/ShowPost.aspx?PostID=128214378
Report Abuse
LordDestroyerChaos is not online. LordDestroyerChaos
Joined: 03 Jun 2012
Total Posts: 5742
16 Mar 2014 10:21 AM
Okay, let me test it again! :D
Report Abuse
meSmashsta is not online. meSmashsta
Joined: 31 Jan 2013
Total Posts: 1002
16 Mar 2014 10:23 AM
@blue

you're right, i'm sorry
Report Abuse
blueboy112 is not online. blueboy112
Joined: 15 Apr 2009
Total Posts: 802
16 Mar 2014 10:24 AM
@meSmash

That's fine, human error and you didn't know.

Look, I do things now! http://www.roblox.com/Forum/ShowPost.aspx?PostID=128214378
Report Abuse
meSmashsta is not online. meSmashsta
Joined: 31 Jan 2013
Total Posts: 1002
16 Mar 2014 10:25 AM
@blue

lol i take my sorry back! when you drop your tool you still get to keep it when you reset, this means you can clone a lot of tools! drop and reset = cloning of tools

this is a bad idea! ha i knew it from the start >:D
Report Abuse
LordDestroyerChaos is not online. LordDestroyerChaos
Joined: 03 Jun 2012
Total Posts: 5742
16 Mar 2014 10:27 AM
It doesn't work.... thanks a lot.... Hahha just kidding, it works!
Report Abuse
LordDestroyerChaos is not online. LordDestroyerChaos
Joined: 03 Jun 2012
Total Posts: 5742
16 Mar 2014 10:30 AM
@me, I made it so if you drop an item it disappears.
Report Abuse
LordDestroyerChaos is not online. LordDestroyerChaos
Joined: 03 Jun 2012
Total Posts: 5742
16 Mar 2014 10:30 AM
@me, with that script that deletes the dropping items, you can't clone.
Report Abuse
blueboy112 is not online. blueboy112
Joined: 15 Apr 2009
Total Posts: 802
16 Mar 2014 10:42 AM
In the tool, there's a value that allows you to not drop them.

Look, I do things now! http://www.roblox.com/Forum/ShowPost.aspx?PostID=128214378
Report Abuse
LordDestroyerChaos is not online. LordDestroyerChaos
Joined: 03 Jun 2012
Total Posts: 5742
16 Mar 2014 10:43 AM
Be right back.
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