|
| 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 |
|
|
|
| 12 Aug 2015 08:53 AM |
game:GetService("ForumService"):MoveThread(170882731, 33)
In other words, wrong forum. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 12 Aug 2015 09:36 AM |
| Obviously the forum called "Scripters." It's pretty self-explanatory. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 12 Aug 2015 10:15 AM |
Whatever, I'll move it to Game Dev because maybe some intelligent people may comment.
|
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 12 Aug 2015 10:18 AM |
"Intelligent people unlike you........" [2]
OH SNAPPP
IT JUST GOT REAL |
|
|
| Report Abuse |
|
|
| |
|