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

What can I do?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

I know this this can only work on LocalScripts, but what can I do to make it when a player touches the part, and then presses the letter to activate the other part?

local Player = game.Players.LocalPlayer
local mouse = Player:GetMouse()

script.Parent.Touched:connect(function(hit)
    mouse.KeyDown:connect(function(Key)
        if Key == "f" then
            game.Workspace.TestDoor.Transparency = 1
        end
    end)
end)

1 answer

Log in to vote
-1
Answered by
LuaQuest 450 Moderation Voter
9 years ago

Your program isn't running because you're putting a local script in a part. Local scripts only work inside the starter Gui, or starter pack.

0
To correct you- Local scripts are functional in Characters and players. (Characters being the model in workspace, Players being the Player its self in Players deputychicken 226 — 9y
Ad

Answer this question