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

How can I get this piano working again or is it beyond the point of repair?

Asked by 8 years ago

Hey, guys! I'm here due to my script not being able to work. The piano is supposed to play a sound (note) when you press certain keys on your keyboard but as you can see, it is not working. Please help because I have no clue why this isn't working.

Here are my scripts.

Normal script:

01wait(5)
02local KeyTool = script["PianoPlayer V1.1"]:Clone()
03script["PianoPlayer V1.1"]:Remove()
04position = script.Parent.Archive.Position
05local frame = Instance.new("CFrameValue")
06frame.Name = "OriginCFrame"
07frame.Value = script.Parent.Archive.CFrame
08frame.Parent = script.Parent
09 
10local object = Instance.new("ObjectValue")
11object.Value = script.Parent.Parent.Parent
12 
13seat = script.Parent.Seat
14 
15function onSitUp(child, hopper, piano, object)
View all 47 lines...

Main Script:

01bin=script.Parent
02 
03function findPiano(player)
04    local list = player.Character:GetChildren()
05    for x = 1, #list do
06        if (list[x].Name == "Instrument") then
07            local weld = list[x].Value:FindFirstChild("Parts"):FindFirstChild("Seat"):FindFirstChild("SeatWeld")
08            if (weld ~= nil) and (weld.Part1 == player.Character:FindFirstChild("Torso")) then
09                return list[x].Value
10            end
11        end
12    end
13--  return nil
14end
15 
View all 88 lines...

Lighting script:

1script.Parent.Parent = game:service("Lighting")
2script.Parent = nil

Sound Script:

01--ToolSoundScript V1.2
02--funtimecameron886
03wait(2)
04 
05local Sound = script.Parent                                 --Defines Sound
06local Bool = Sound.Run                                  --BoolValue activated by outside script to request sound
07 
08 
09function Play()
10    wait()
11    if Bool.Value == true then
12        Sound:Play()                                    --Plays the sound
13        wait()
14        Bool.Value = false
15    end
16end
17 
18 
19Bool.Changed:connect(Play)

Hope you guys know how to solve this!

0
Why are you using lighting? Can you privede some more infor about what is not working, e.g. add in some prints so we know what is running and what is not running. User#5423 17 — 8y

Answer this question