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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Item Giver/Remover

Previous Thread :: Next Thread 
brickzombie is not online. brickzombie
Joined: 18 Jan 2012
Total Posts: 260
02 Feb 2014 04:03 PM
So am am trying to make a king of the hill game. I am aiming for you to only have a sword when your physically touching the hill its self.

So I was trying to make a script that gave you a "sword" when you touch it, only if you you don't have a "sword " already.

I also was trying to make a script that removed all the "sword" you have in your inventory when you touch it.

I was only able to make scripts that give you a tool endlessly and that removes all tools you have. I also couldn't find an example of what I wanted, making it hard to script it.

If someone could please write me scripts for the two things I mentioned above, I would be very grateful. Thank you for helping me out!
Report Abuse
brickzombie is not online. brickzombie
Joined: 18 Jan 2012
Total Posts: 260
02 Feb 2014 04:26 PM
Can anyone help me out?
Report Abuse
brickzombie is not online. brickzombie
Joined: 18 Jan 2012
Total Posts: 260
02 Feb 2014 06:02 PM
Anyone?
Report Abuse
brickzombie is not online. brickzombie
Joined: 18 Jan 2012
Total Posts: 260
02 Feb 2014 07:03 PM
Please?
Report Abuse
brickzombie is not online. brickzombie
Joined: 18 Jan 2012
Total Posts: 260
02 Feb 2014 07:43 PM
bump
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
02 Feb 2014 07:46 PM
Hill.TouchEnced:connect(function(hats)

end)
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
02 Feb 2014 07:48 PM
Using TouchEnded is not the best way to do this...
Report Abuse
brickzombie is not online. brickzombie
Joined: 18 Jan 2012
Total Posts: 260
02 Feb 2014 07:52 PM
Do you have a better idea? If so, I would like to hear it!
Report Abuse
brickzombie is not online. brickzombie
Joined: 18 Jan 2012
Total Posts: 260
02 Feb 2014 08:13 PM
?
Report Abuse
Arcionus is not online. Arcionus
Joined: 30 Jan 2014
Total Posts: 208
02 Feb 2014 08:27 PM
I actually have this same problem, my item giver just endlessly gives tools. It gets really annoying.
Report Abuse
brickzombie is not online. brickzombie
Joined: 18 Jan 2012
Total Posts: 260
02 Feb 2014 08:29 PM
you need to have it check your items first, I just don't know how to script that...
Report Abuse
crazyfireball2002 is not online. crazyfireball2002
Joined: 27 Sep 2010
Total Posts: 275
02 Feb 2014 08:33 PM
make a local script

local Player = game.Players.LocalPlayer

function Give()
if Player.Backpack:findFirstChild("SwordNameHere")== nil then
--Sword Give Code Here
end
end

script.Parent.Touched(Give)
Report Abuse
brickzombie is not online. brickzombie
Joined: 18 Jan 2012
Total Posts: 260
02 Feb 2014 08:54 PM
doesn't seem to work with my item giver script.
Report Abuse
shinybearhead is not online. shinybearhead
Joined: 24 Jan 2011
Total Posts: 135
02 Feb 2014 08:56 PM
script.Parent.Touched:connect(function(p)
pl = game.Players:GetPlayerFromCharacter(p.Parent)
if not pl.Backpack:findFirstChild("Sword") then
print'has'
else
PUTLOCATIONOFSWORDHERE.sword:clone().Parent = pl.Backpack
end
end)
Report Abuse
Grove537 is not online. Grove537
Joined: 05 Feb 2010
Total Posts: 3478
02 Feb 2014 08:59 PM
Put this in ur little giver brick thing:

function touch(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
plr = game.Players:FindFirstChild(hit.Parent.Name)
if plr.Backpack:FindFirstChild("Sword Name Here") == nil then
--go to your sword here and clone it to plr.Backpack
else
plr.Backpack["Sword Name Here"]:Destroy()
end
end
end
script.Parent.Touched:connect(touch)

Report Abuse
brickzombie is not online. brickzombie
Joined: 18 Jan 2012
Total Posts: 260
02 Feb 2014 09:06 PM
Works good, thanks!
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