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

How would I convert this script to work with filtering enabled?

Asked by 6 years ago

Since ROBLOX added the new rule I would like to know how I could convert this script so that it is filtering enabled compatible.

local s = game.ServerStorage.C
local size = false
local coffee = false
local ready = false
local inwork = false
local toolcheck = false
local coffeo = {"Regular","Expresso","Macchiato","Latte"}
local sizeo = {"Medium","Small","Large"}
local extras = {"Chocolate","Vanilla","Caramel"}
local buildtext1 = ""
local player = game.Players:GetPlayers()
local correct = ""

function verify()
    if inwork == true then
        print("in workspace")
    elseif inwork == false then
        prepare()
    end
end

function prepare()
    local size1 = sizeo[math.random(#sizeo)]
    local extras1 = extras[math.random(#extras)]
    local coffee1 = coffeo[math.random(#coffeo)]
    local buildtext = "I would like a "
    correct = size1.." "..extras1..""..coffee1
    buildtext = buildtext..size1.." "..extras1.." "..coffee1
    buildtext1 = buildtext
    ready = true
    print(buildtext)
    textbuilder()
end

function textbuilder()
    s.Head.sc.SurfaceGui.TextLabel.Text = buildtext1
    ready = true
    s:clone().Parent = game.Workspace
    inwork = true
end

game.Workspace.checker.censor.Touched:connect(function(h)
    if (h.Parent.Name == correct) then
    game.Workspace.C.Head.sc.SurfaceGui.TextLabel.Text = "Thank you!"
    wait(5)
    inwork = false
    ready = false
    game.Workspace.c:destroy()
    elseif (h.Parent.Name ~= correct and h.Parent.ClassName == "Tool") then
        game.Workspace.C.Head.sc.SurfaceGui.TextLabel.Text = "I didn't order this!"
        wait(5)
        ready = false
        inwork = false
        game.Workspace.C:destroy()
end
end)

game.Workspace.aaaa.ClickDetector.mouseClick:connect(verify)
1
A click detector works with FE and as far as i can see there is nothing that needs to be changed since this can all run on the server side. User#5423 17 — 6y
0
Please look on the wiki first on how to make things FE compatible, and learn how it works to know what you need to change to make it compatible. hiimgoodpack 2009 — 6y

1 answer

Log in to vote
0
Answered by
Asceylos 562 Moderation Voter
6 years ago

There is no reason why it should be a local script or not FE compatible. Just make it a server script and it will work with FE without making any changes.

Ad

Answer this question