I'm trying to make a quest like script. I don't know why, but this script doesn't work with filtering enabled. How come? I know what filtering is, but is it something the server can't access or what?
function check(Player, Choice) if Choice.Name == "DialogChoice1" then if Player.Backpack:FindFirstChild("GravityCoil") == nil then print ("No G Coil") script.Parent.DialogChoice.UserDialog = "Okay, Bye!" script.Parent.DialogChoice.ResponseDialog = "See ya later!" else print ("G coil found!") script.Parent.DialogChoice.UserDialog = "I have the coil." script.Parent.DialogChoice.ResponseDialog = "You actually got it??? Thanks a ton! Here's a reward!" wait(2.5) local rs = game:GetService("ReplicatedStorage") local clone = rs.Tape:Clone() clone.Parent = Player.Backpack Player.Backpack.GravityCoil:Remove() end end end
local function check(Player, Choice) if Choice.Name == "DialogChoice1" then if not Player.Backpack:FindFirstChild("GravityCoil") then print("No G Coil") script.Parent.DialogChoice.UserDialog = "Okay, Bye!" script.Parent.DialogChoice.ResponseDialog = "See ya later!" else print("G coil found!") script.Parent.DialogChoice.UserDialog = "I have the coil." script.Parent.DialogChoice.ResponseDialog = "You actually got it??? Thanks a ton! Here's a reward!" wait(2.5) local rs = game:GetService("ReplicatedStorage") local clone = rs.Tape:Clone() clone.Parent = Player.Backpack Player.Backpack.GravityCoil:Destroy() -- :Remove is deprecated, use :Destroy end end end script.Parent.DialogChoiceSelected:Connect(check) -- under your dialog object