Script Doesnt Check Children And Bring Tool From ReplicatedStorage To Workspace?
im making a script that, theres a prox prompt, once you activate it while holding an item, that item gets bring into workspace and removes the item, once all of them are in workspace, the script brings a tool from replicated storage and parents it to workspace, removes the original model with the items, adds a point to a task menu (shared for all players) enables a new prox point and disabled the original prox point, it was working before, but for some reason it stopped working and is now broken, can anyone help?
06 | script.Parent.Triggered:Connect( function (plr) |
07 | if plr.Character:FindFirstChild( "Tomato Soup" ) then |
08 | game:GetService( "ReplicatedStorage" ).Ingreds [ "Tomato Soup" ] .Parent = workspace.Cooking.Pot |
09 | plr.Character:FindFirstChild( "Tomato Soup" ).Parent = nil |
12 | if plr.Character:FindFirstChild( "Orange" ) then |
13 | game:GetService( "ReplicatedStorage" ).Ingreds [ "Oranges" ] .Parent = workspace.Cooking.Pot |
14 | plr.Character:FindFirstChild( "Orange" ).Parent = nil |
17 | if plr.Character:FindFirstChild( "Ham" ) then |
18 | game:GetService( "ReplicatedStorage" ).Ingreds [ "Ham" ] .Parent = workspace.Cooking.Pot |
19 | plr.Character:FindFirstChild( "Ham" ).Parent = nil |
22 | if plr.Character:FindFirstChild( "Chocolate" ) then |
23 | game:GetService( "ReplicatedStorage" ).Ingreds [ "Chocolate" ] .Parent = workspace.Cooking.Pot |
24 | plr.Character:FindFirstChild( "Chocolate" ).Parent = nil |
29 | local player = game:GetService( "Players" ).LocalPlayer |
30 | local playergui = player.PlayerGui |
33 | while tomato = = true and choco = = true and ham = = true and orange = = true do |
34 | script.Parent.Enabled = false |
35 | game:GetService( "ReplicatedStorage" ) [ "Full Pot" ] .Parent = workspace.Cooking |
36 | workspace.Cooking.POTinoven.ProximityPrompt.Enabled = true |
37 | playergui.Tasks.Frame.cook.Value.Value + = 1 |
38 | script.Parent.Parent.Parent:Destroy() |