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

What am I doing wrong and teach me what is right for this? (Filtering Enabled)

Asked by
s7ana 0
6 years ago
Edited 6 years ago

Okay so I am new to scripting and decided to try my hand at it, and I haven't really made anything yet where filtering enabled turned on in my game would make something not be able to work yet. However I've heard a little bit of how it works, but I don't really have a good idea I think on how to work around it so things properly do what I want them to do.

I've been learning through the Roblox wiki and I decided to try my hand at this: http://wiki.roblox.com/index.php?title=Creating_a_Dialog_Shop

local dialog = script.Parent

dialog.DialogChoiceSelected:connect(function(player, choice)
    if choice == script.Parent.TakeStick then
        game.ReplicatedStorage.WoodStick:Clone().Parent = player.Backpack
    end
end)

I followed it and it works in Roblox Studio play test, but not in Client+Server play test. So I figured maybe it had something to do with filtering enabled.

So far I have looked at the link above, https://wiki.roblox.com/index.php?title=Remote_Functions_%26_Events and also https://scriptinghelpers.org/questions/35580/how-to-use-guis-with-filtering-enabled. The last one is for GUI but I thought maybe it can be useful in some way.

I really didn't understand everything too well, but I thought if I combined the info of all the links above I could maybe figure this out myself. So here's what I've done thus far:

Trying to do a simple dialogue talk to a stick on the ground, select a choice which adds the stick to your backpack toolbar (I already have the stick ready for equipping out of the box.).

-- I put a RemoteEvent manually into game.Workspace.

-- Next I edited the script that I had above within game.Workspace.Model.Head.Dialog.Script to be:

local dialog = script.Parent

dialog.DialogChoiceSelected:connect(function(player, choice)
    if choice == script.Parent.TakeStick then
        game.Workspace.RemoteEvent:FireServer()
    end
end)

This is from me taking what I learned from the Dialog Shop tutorial + How to use GUI's with filtering enabled links I posted above.

-- Then I put this script into ServerScriptService:

local dialog = game.Workspace.Model.Head.Dialog

if game.Workspace.RemoteEvent.OnServerEvent then
    dialog.DialogChoiceSelected:connect(function(player, choice)
        if choice == dialog.TakeStick then
            game.ReplicatedStorage.WoodStick:Clone().Parent = player.Backpack
        end
    end)
end

(I have my WoodStick tool inside ReplicatedStorage, I think that's where it's supposed to be. Got the idea from the Dialog Shop tutorial.)


The above is what I've done, and it works on the Roblox Studio play test but not the Client + Server play test.

So I decided to read the Remote Functions & Events again on the Roblox wiki. Now, I don't know if the answer is literally right there in front of my face and I'm just too dumb to realize it. But I am really confused on what to do since https://wiki.roblox.com/index.php?title=Remote_Functions_%26_Events does not have anything on it (To me.) that would fix my problem.

I only see stuff that explains what I believe to be making a new part within the workspace or something to do with making message popups. Nothing for my dialog shop to be able to add a tool to my backpack toolbar.

I came here for someone to open my mind for what I'm doing wrong, and also how to apply what I'm trying to do; To work for filtering enabled through what I think I need is some kind of remote function or event. If I don't need to use those then blow my mind with a simple solution I never even thought of for some reason.

Sorry if this maybe is a request (I'm new here and don't know what a request looks like but read some kind of rules before I posted this.). But I've tried what I can what intelligence I have. (Yes, I've tried google but only come up with YT vids that only "show but never tell why" and pretty much give me a shop for free. But I didn't really learn anything I think.)

[Additional: No, I don't want to learn how to touch the stick on the ground with your feet to add it to your backpack.]

0
Quick tip: Don't make your post this long unless there is a good reason(tricky technical question). People just won't want to read it and understand. lukeb50 631 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Where you able to figure this out? I am having a similar issue but have yet to find a good answer.

Ad

Answer this question