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

Another localscript broken?

There's no error.

--TetherBLOX

one = script.Parent.Part1
two = script.Parent.Part2
three = script.Parent.Part3


one.Visible = true
ew = false
go = true

function new()
	mouse = game.Players.LocalPlayer:GetMouse()
	mouse.KeyDown:connect(function(keyPressed)
		if keyPressed == 'f' and go then
			go = false
			one.Visible = false
			two.Visible = true
			wait(1)
			ew = true
			if ew == true then
				two.Visible = false
				three.Visible = true
				wait(3)
				three.Visible = false
			end
		end
	end)
end
game.Players.PlayerAdded:connect(new)

5 comments

0

Run it in game, Then click on F9 for the Local Script Console

0

Where is the Local Scipt Located in the game?

0

in ScreenGui>Frame

0

Are the 3 values defined at the top parts or GUI elements?

0

GUI elements

2 answers

If you are using a localscript you don't need to wait for a player to be added, the player is already added.

--TetherBLOX

one = script.Parent.Part1
two = script.Parent.Part2
three = script.Parent.Part3


one.Visible = true
ew = false
go = true

mouse = game.Players.LocalPlayer:GetMouse()
mouse.KeyDown:connect(function(keyPressed)
   if keyPressed == 'f' and go then
        go = false
        one.Visible = false
        two.Visible = true
        wait(1)
        ew = true
        if ew == true then
            two.Visible = false
            three.Visible = true
            wait(3)
            three.Visible = false
        end
    end
end)

The thing is, the mouse.KeyDown isn't registering.

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