Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make CFrame script to RemoteEvent?

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)

2 comments

0

activate an event when the mouse is clicked and change the doors cframe on the server

0

you could do this all with a script and wouldn't even need an event

1 answer

✓ Accepted answer

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)

2 comments

0

can i get remoteevent script?

0

you don't need a remoteevent for this.

This discussion is preserved as it was. New answers, comments, and votes are closed.