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

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

Asked by
scull42 -5
6 years ago

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)
0
change line 2 into button = script.Parent.Parent:WaitForChild("Enter") Bellyrium 310 — 6y
0
ive done this, still works in studio bute keypad is still unresponsive after i publish it. scull42 -5 — 6y

1 answer

Log in to vote
-2
Answered by
wookey12 174
6 years ago

put it in a local script

0
how would i do that? sorry im not very good at scripting. scull42 -5 — 6y
Ad

Answer this question