|
| 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 |
|
|
|
| 16 Mar 2014 09:45 AM |
| Thank you so much guys! :) |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 16 Mar 2014 10:07 AM |
| Thank you som much! Want RBX? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 30 Sep 2012 |
| Total Posts: 227 |
|
|
| 16 Mar 2014 10:18 AM |
@above No actually it won't. |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 16 Mar 2014 10:21 AM |
| Okay, let me test it again! :D |
|
|
| Report Abuse |
|
|
|
| 16 Mar 2014 10:23 AM |
@blue
you're right, i'm sorry |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 16 Mar 2014 10:27 AM |
| It doesn't work.... thanks a lot.... Hahha just kidding, it works! |
|
|
| Report Abuse |
|
|
|
| 16 Mar 2014 10:30 AM |
| @me, I made it so if you drop an item it disappears. |
|
|
| Report Abuse |
|
|
|
| 16 Mar 2014 10:30 AM |
| @me, with that script that deletes the dropping items, you can't clone. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|