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 » Roblox » Help (Technical Support and Account Issues)
Home Search
 

Scripting Help.

Previous Thread :: Next Thread 
revofevguy is not online. revofevguy
Joined: 05 Sep 2010
Total Posts: 113
12 Aug 2015 08:26 AM
Now, I know that this most likely does not belong here, but I don't know where else it goes.

I need some quick help with this script.

I'm making a post apocalyptic pawn shop for my game, and-

Right now, the script is talking every tool in the player's backpack but only giving reward for one tool. I'd like someone to assist me in finding out how to make the script detect how many tools are in the backpack, and reward for each of them, or just make it take one tool and reward for only that one tool.

Here is the script:
------------------------------

talky = "Great Trade!" -- this is the message that will pop up if they have the item.
talk = "Return with the Item.." -- this is the message that will pop up if they don't have the item.
reward = 10 -- the reward!

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 onTouch(part)

local human = part.Parent:findFirstChild("Humanoid")
if (human ~= nil) and debounce == false then
debounce = true
local player = getPlayer(human)
if (player == nil) then return end
user = game.Players:findFirstChild(human.Parent.Name)
local gold = user.leaderstats.XP
if player.Backpack:findFirstChild("Medication") ~= nil then --Tool Name
gold.Value = gold.Value + reward
m = Instance.new("Hint", player)
m.Text = talky
-- below make sure the Quest Item get rewarded and remove from the players inventory.
player.Backpack:findFirstChild("Medication"):remove() --Tool Name
m:Remove()
else
m = Instance.new("Hint", player)
m.Text = talk
wait(3)
m:Remove()
end
wait(2)
debounce = false
end end

script.Parent.Touched:connect(onTouch)
Report Abuse
cybersquat is not online. cybersquat
Joined: 02 Aug 2015
Total Posts: 5835
12 Aug 2015 08:53 AM
game:GetService("ForumService"):MoveThread(170882731, 33)

In other words, wrong forum.
Report Abuse
revofevguy is not online. revofevguy
Joined: 05 Sep 2010
Total Posts: 113
12 Aug 2015 09:16 AM
"Now, I know that this most likely does not belong here, but I don't know where else it goes."

In other words- There is no other forum that fits this criteria that I have seen.
Report Abuse
cybersquat is not online. cybersquat
Joined: 02 Aug 2015
Total Posts: 5835
12 Aug 2015 09:36 AM
Obviously the forum called "Scripters." It's pretty self-explanatory.
Report Abuse
revofevguy is not online. revofevguy
Joined: 05 Sep 2010
Total Posts: 113
12 Aug 2015 10:12 AM
I do believe I read this-

Scripters
This is the place for discussion about scripting. Anything about scripting that is **NOT** a **help request** or topic belongs here.
Report Abuse
cybersquat is not online. cybersquat
Joined: 02 Aug 2015
Total Posts: 5835
12 Aug 2015 10:14 AM
"Suggestions & Ideas
Do you have a suggestion and ideas for ROBLOX? Share your feedback here."

How is this a suggestion? Or idea?

Do you see anyone in Scripters following that rule? Scripters is only for help requests. Nobody "talks about scripting."
Report Abuse
revofevguy is not online. revofevguy
Joined: 05 Sep 2010
Total Posts: 113
12 Aug 2015 10:15 AM
Whatever, I'll move it to Game Dev because maybe some intelligent people may comment.
Report Abuse
cybersquat is not online. cybersquat
Joined: 02 Aug 2015
Total Posts: 5835
12 Aug 2015 10:16 AM
Intelligent people unlike you, since you lack the basic knowledge to decide the proper forum this goes in.
Report Abuse
cybersquat is not online. cybersquat
Joined: 02 Aug 2015
Total Posts: 5835
12 Aug 2015 10:18 AM
Whoops. I forgot this isn't S&I.

My point still stands:

"Help (Technical Support and Account Issues)
Seeking account or technical help? Post your questions here."

This isn't account help nor is it technical help.
Report Abuse
epicdarkbunchie is not online. epicdarkbunchie
Joined: 19 May 2012
Total Posts: 58
12 Aug 2015 10:18 AM
"Intelligent people unlike you........" [2]

OH SNAPPP

IT JUST GOT REAL
Report Abuse
revofevguy is not online. revofevguy
Joined: 05 Sep 2010
Total Posts: 113
12 Aug 2015 10:21 AM
Good job *Slow clap*
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Roblox » Help (Technical Support and Account Issues)
   
 
   
  • 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