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
 

Scripting Shops

Previous Thread :: Next Thread 
Angel8365 is not online. Angel8365
Joined: 26 Apr 2010
Total Posts: 101
03 Apr 2012 06:46 AM
I need help, when i make a shop it works but when you die you lose the item you purchased. How do i fix that?
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
03 Apr 2012 06:55 AM
[ Content Deleted ]
Report Abuse
Angel8365 is not online. Angel8365
Joined: 26 Apr 2010
Total Posts: 101
03 Apr 2012 06:58 AM
This is the shop script tell me if anything is wrong that won't make it save.

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("Gold")
if sp == nil then return false end
if (sp.Value >= 10) then
sp.Value = sp.Value - 10
print("Enough Money")
game.Lighting.BronzeSword:clone().Parent = player.Backpack
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
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
03 Apr 2012 08:09 AM
I'm not even going to look at the script; just add all the weapons they buy into the script, and when they die, re-add them to their backpack.
Report Abuse
rossb654mail is not online. rossb654mail
Joined: 12 Oct 2009
Total Posts: 11004
03 Apr 2012 08:15 AM
Or when it clones the tool, make sure to put it in their Starttools or whatever folder
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
03 Apr 2012 08:25 AM
It is called SarterGear, I think. If you put it in StarterPack, everybody gets it.
Report Abuse
Angel8365 is not online. Angel8365
Joined: 26 Apr 2010
Total Posts: 101
03 Apr 2012 03:32 PM
How do i re add weapons to their backpack?
Report Abuse
juriaan is not online. juriaan
Joined: 25 Nov 2008
Total Posts: 939
03 Apr 2012 04:09 PM
Alright here a Little way of doing it

Tools = {"Sword"}

Game.Players.PlayerAdded:connect(function(new)
local val = Instance.new("IntValue")
val.Name = "Weaponkeep"
val.Parent = new
local ba = Instance.new("BoolValue")
ba.Name = "SwordGot"
ba.Parent = val
end)

Game.Workspace.ChildAdded:connect(function(newc)
if game.Players:findFirstChild(newc.Name) then
if game.Players[newc.Name].Weaponkeep.SwordGot.Value == true then
Game.Lighting[Tools[i]]:clone().Parent = Game.Players[newc.Name].Backpack
else
print("Error !")
end
else
print("Not a Player")
end
end)

Glad to help,
Juriaan and Velibor

~ Server Lab is coming soon ! ~
Report Abuse
Defendur is not online. Defendur
Joined: 31 Mar 2012
Total Posts: 40
03 Apr 2012 04:28 PM
Okay. Player has two types of gear.

StarterGear (that one player gets it when he spawns, just like Gear, only if it was allowed)

BackPack (a temporary toolkit.)

StarterPack automatically inserts a tool into everyones BackPack when the player spawns.
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