Quest System I Made Not Working With No Errors?
Asked by
5 years ago Edited 5 years ago
So the script is:
01 | local tools = game.ReplicatedStorage.ChristmasEvent:GetChildren() |
02 | local starterGui = game:GetService( 'Players' ).LocalPlayer:WaitForChild( 'PlayerGui' ) |
03 | game.Workspace [ "Gingerbread Man" ] .Head.Dialog.DialogChoiceSelected:connect( function (player, Dialog) |
04 | if Dialog.Name = = 'QuestGiver' then |
05 | starterGui.Quests.QuestsText.Text = "Quest: 0/8 Reindeer And 0/5 Sleigh Parts" |
06 | if game.Players.LocalPlayer.Backpack:FindFirstChild(tools) then |
07 | local clone = game.ReplicatedStorage.Eggnog:Clone() |
08 | clone.Parent = game.Players.LocalPlayer:FindFirstChild( "Backpack" ) |
The problem is at the end i doesn't give me the Eggnog and shows no errors. Christmas Event (Line 1) has all the items I want to be in the player's inventory. My original problem was everything was in server storage and when I thought for once I realized server can't be accessed by local script. So I just changed it to replicated (Simple). I have the items in my inv and it just doesn't give me the eggnog any suggestions?
SOLVED: FindFirstChild can't be done with a variable so I tried GetChildren(tools) and it worked fine thanks everyone who tried to help! :)