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

keypad is unresponsive when used in roblox player, but worked fine in roblox studio?

I have a keypad that when you input the correct code, an NPC appears. I tested this in Roblox Studio and the NPC appeared when the correct code was entered. I then published the game to roblox without changing anything, then I played the game on the roblox website instead of studio, and the keypad is no longer detecting any clicks and is unresponsive. Can someone help with this?

here is code if it helps

Code = "629434"
button = script.Parent.Parent.Enter
function Enter()
if (script.Parent.Text == Code) then
print("Accepted")
script.Parent.Text = "CODE ACCEPTED"
script.Parent.Parent.Sound2:play()
wait(0.5)
script.Parent.Text = ""
--here down is script i wrote
local function Show(part)
	part.Transparency = 0.4
end

local function activate(part)
	part.Dialog.InUse = false
end

activate(Game.Workspace.hologram.hologram.Model.Model.scull42.Head)

Show(Game.Workspace.hologram.hologram.Model.Model.scull42.Bandana.Handle)
Show(Game.Workspace.hologram.hologram.Model.Model.scull42.LOLcap.Handle)
Show(Game.Workspace.hologram.hologram.Model.Model.scull42.Head)
Show(Game.Workspace.hologram.hologram.Model.Model.scull42["Left Arm"])
Show(Game.Workspace.hologram.hologram.Model.Model.scull42["Left Leg"])
Show(Game.Workspace.hologram.hologram.Model.Model.scull42["Right Arm"])
Show(Game.Workspace.hologram.hologram.Model.Model.scull42["Right Leg"])
Show(Game.Workspace.hologram.hologram.Model.Model.scull42.Torso)
Show(Game.Workspace.hologram.hologram.Model.Model.scull42.Head.face)
--here down i did not write

return end
script.Parent.TextColor3 = Color3.new(1,0,0)
wait(0.1)
script.Parent.TextColor3 = Color3.new(1,1,1)
wait(0.1)
script.Parent.TextColor3 = Color3.new(1,0,0)
wait(0.1)
script.Parent.TextColor3 = Color3.new(1,1,1)
wait(0.1)
script.Parent.TextColor3 = Color3.new(1,0,0)
wait(0.1)
script.Parent.TextColor3 = Color3.new(1,1,1)
wait(0.1)
script.Parent.Text = "CODE DENIED"
script.Parent.Parent.Sound3:play()
wait(0.1)
script.Parent.Parent.Sound3:play()
script.Parent.TextColor3 = Color3.new(1,0,0)
wait(0.5)
script.Parent.TextColor3 = Color3.new(1,1,1)
script.Parent.Text = ""
print("Denied")
end

button.MouseButton1Click:connect(Enter)

2 comments

0

change line 2 into button = script.Parent.Parent:WaitForChild("Enter")

0

ive done this, still works in studio bute keypad is still unresponsive after i publish it.

1 answer

put it in a local script

1 comment

0

how would i do that? sorry im not very good at scripting.

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