vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 21 Dec 2013 03:28 PM |
Quests = script.Parent.Quests Quest = Quests:GetChildren()
function Change() for i,v in pairs(Quest) do if v.Value >= 1 then Quests.Value = Quests.Value + 1 end end end
for i, v in pairs(Quest) do v.Changed:connect(function() Change() end) end |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
| |
|
wubbzy301
|
  |
| Joined: 15 May 2010 |
| Total Posts: 1188 |
|
| |
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 21 Dec 2013 03:38 PM |
@wubbzy301
WHAT
If you are not going to help, LEAVE.
|
|
|
| Report Abuse |
|
|
wubbzy301
|
  |
| Joined: 15 May 2010 |
| Total Posts: 1188 |
|
|
| 21 Dec 2013 03:41 PM |
"hurry?" I can't solve that. |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 21 Dec 2013 03:42 PM |
| Yes, I want to continue, so hurrying would be great. It would also be great if you would leave this forum instead of posting: "You are not a good scripter, learn it" or "Nobody cares". Scripting HELPERS are people who HELP people with fixing scripts. You aren't so leave. |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 21 Dec 2013 05:05 PM |
| Bump, no need to hurry anymore but please respond. |
|
|
| Report Abuse |
|
|
|
| 21 Dec 2013 05:07 PM |
Try this:
Quests = script.Parent.Quests Quest = Quests:GetChildren()
function Change() for i,v in pairs(Quest) do if v.Value >= 1 then Quests.Value = Quests.Value + 1 end end end
for i, v in pairs(Quest) do v.Changed:connect(Change) end |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 21 Dec 2013 05:12 PM |
| Problem is, the first time it neither changes. |
|
|
| Report Abuse |
|
|
|
| 21 Dec 2013 05:19 PM |
Why not just make it check if a child was added then it will fire the function change()?
You want the script to basically fire the function change() when there is another "Quest" added? right? Are the quests like bricks or values? I need to know. |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 22 Dec 2013 05:23 AM |
Player >Quest -- Value >>Quest1 -- Values >>Quest2 >>Quest3 |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2013 06:20 AM |
| sorry i cannot help but i would if i could.i only just started to learn how to script :) |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2013 06:23 AM |
Quests = script.Parent.Quests Quest = Quests:GetChildren()
for i=1,#Quest do Quest[i].Changed:connect(function() if Quest[i].Value >= 1 then Quests.Value = Quests.Value + 1 end end) end
i dont get it what are you trying to do to change awery quest number + 1 when each of them changes ?? |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2013 06:26 AM |
Quests = script.Parent.Quests Quest = Quests:GetChildren()
for i=1,#Quest do Quest[i].Changed:connect(function() Quests.Value = 0 for i,v in pairs(Quests:GetChildren())do if v.Value >= 1 then Quests.Value = Quests.Value + 1 end end end) end
if that one buggy try this one |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 22 Dec 2013 07:01 AM |
Nope, this is what I'm trying to make:
Quests.Value ( How many there are active, 1 is able to get it 0 is you aren't able to get it. 2 or higher is when you've got it and/or did some progress in it. |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 22 Dec 2013 08:09 AM |
y u use intvalues
Quests = { KillOrcsQuest = { -- just an example canget = false; queststage = 1; endstage = 10; desc = "ORCS MUST DIE"; name = "Kill Orcs" reward = { gold = 50 item = "LinkedSword" } } }
if Quests.KillOrcsQuest.canget == true then currentquest = Quests.KillOrcsQuest -- do quest acquiring stuff if currentquest.queststage == currentquest.endstage then -- do reward stuff end
|
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 22 Dec 2013 08:20 AM |
| That will come later in the GUI, this is for seeing how many active quests the player has. |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 22 Dec 2013 08:36 AM |
| A table would be easier to manage and exploiters have a harder time trying to change their stats |
|
|
| Report Abuse |
|
|
Vermis
|
  |
| Joined: 02 Jan 2013 |
| Total Posts: 11501 |
|
| |
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 22 Dec 2013 08:41 AM |
I could make TotalMoneyHad TotalMoneySpend TotalMoneyCurrently if its not equal, you get kicked for hacking? |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 22 Dec 2013 09:04 AM |
| people can make scripts to get around |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2013 09:28 AM |
Quests = script.Parent.Quests Quest = Quests:GetChildren()
for f, p in pairs(Quest) do p.Changed:connect(function() for i,v in pairs(Quest) do if v.Value >= 1 then Quests.Value = Quests.Value + 1 end end end end) end
|
|
|
| Report Abuse |
|
|
wubbzy301
|
  |
| Joined: 15 May 2010 |
| Total Posts: 1188 |
|
| |
|