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
 

How come it inserts multiples.

Previous Thread :: Next Thread 
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
10 Jul 2013 06:42 PM
local q = "Chicken find" -- CoD this is case sensitive just like in the other script..
local a = script.QuestInfo

script.Parent.Touched:connect(function(h)
if h.Parent:findFirstChild("Humanoid") then
local hh = h.Parent.Name
local hhh = game.Players:findFirstChild(hh)
local z = a:clone()
if hhh:findFirstChild(q) then

elseif hhh.PlayerGui:findFirstChild("QuestInfo") then

else
if hhh:findFirstChild(q) then

else
local zz = z.Quest
zz.Parent = hhh
zz.Name = zz.Value
z.Parent = hhh.PlayerGui
end
end
end
end)


I just want this to insert one. And then if you already found it in the player then don't insert one, but it does.
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
10 Jul 2013 07:42 PM
Add a debounce.
http://wiki.roblox.com/index.php/Debounce

Also, your if statements seem to be a tad overcomplicated..

local q = "Chicken find" -- CoD this is case sensitive just like in the other script..
local a = script.QuestInfo
local db = false

script.Parent.Touched:connect(function(h)
if db then return end
db = true
plr = game.Players:GetPlayerFromCharacter(h.Parent)
if h and not h.PlayerGui:FindFirstChild("QuestInfo") and not plr:FindFirstChild(q) then
local z = a:clone()
local zz = z.Quest
zz.Parent = plr
zz.Name = zz.Value
z.Parent = plr.PlayerGui
end
db = false
end)
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