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?

01local Player = game.Players.LocalPlayer
02local mouse = Player:GetMouse()
03 
04script.Parent.Touched:connect(function(hit)
05    mouse.KeyDown:connect(function(Key)
06        if Key == "f" then
07            game.Workspace.TestDoor.Transparency = 1
08        end
09    end)
10end)

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