Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script works in local test but not with filtering enabled?

Asked by 5 years ago

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
0
I would use an SendNotification CoreGUI when player enters the area, http://wiki.roblox.com/index.php?title=API:Class/StarterGui/SetCore AswormeDorijan111 531 — 5y
0
Is this a server script? Leamir 3138 — 5y
0
Also try putting the rs:WaitForChild("Tape"):Clone() on line 13 AswormeDorijan111 531 — 5y
0
WaitForChild doesn't fix the problem User#19524 175 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Probably will not help but I fixed this script up. I had to ._. Make sure it's a server script or else it doesn't work.

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
0
It is a server script and do you have any idea why this doesn't work? awad6314 9 — 5y
Ad

Answer this question