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

How to make CFrame script to RemoteEvent?

Asked by 6 years ago

I am making a door for filtering enabled,its working on Roblox Studio but its isn't working on Online.How to make this for RemoteEvent? Script:

function onClicked()
    Door = script.Parent.Parent.Door

    if Door.open.Value == true then
        Door.open.Value = false
        for i = 1, 10 do
            Door.CFrame = CFrame.new(Door.Position + Vector3.new(0, 0.1, 0))
            wait(0.1)
        end
    end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

0
activate an event when the mouse is clicked and change the doors cframe on the server NexanianStudios 91 — 6y
0
you could do this all with a script and wouldn't even need an event Vulkarin 581 — 6y

1 answer

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

Line two must be local Door. And this must be in a serverscript.

function onClicked()
    local Door = script.Parent.Parent.Door

    if Door.open.Value == true then
        Door.open.Value = false
        for i = 1, 10 do
            Door.CFrame = CFrame.new(Door.Position + Vector3.new(0, 0.1, 0))
            wait(0.1)
        end
    end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

0
can i get remoteevent script? FrezeTagger 75 — 6y
0
you don't need a remoteevent for this. DaWarTekWizard 169 — 6y
Ad

Answer this question