Hello there!
I am currently having a bit of an issue trying to make the class Sound
play once inserting the content, SoundId
in my Script. I analyzed everything throughout the Output/Developer Console, but everything seems fine regarding the finding+ waiting for the child and adding properties into the object as their parent, except for the little line in the code down below:
findObject = workspace:WaitForChild("TheUnionObject")
if findObject then
newParticle = Instance.new("ParticleEmitter", workspace)
newParticle.Parent = workspace.TheUnionObject
if newParticle.Parent then
print("Something was added to the Union with a rope")
elseif nil then
print("Something is wrong!")
end
findtheParticleEmitter = game:FindFirstChild(workspace.TheUnionObject.ParticleEmitter)
if findtheParticleEmitter then
workspace.TheUnionObject.ParticleEmitter.Color = ColorSequence.new(Color3.fromRGB(255, 170, 255))
workspace.TheUnionObject.ParticleEmitter.Texture = "http://www.roblox.com/asset/?id=2289899349"
end
for index = 1, 1 ,1 do
print(index)
break
end
newSound = Instance.new("Sound", workspace)
newSound.Parent = workspace.TheUnionObject
if newParticle.Parent then
print("Roblox sound was added to the Union with a rope")
elseif nil then
print("The Roblox sound was not created. Try analyzing the script")
findtheSound = game:FindFirstChild(workspace.TheUnionObject.Sound)
if findtheSound then
local UnionSound = workspace.TheUnionObject.Sound
UnionSound.SoundId = "rbxassetid://6107075664"
UnionSound.Volume = 0.75
UnionSound:Play()
wait(15)
print("Roblox sound in the Union was set to be looped.")
UnionSound.Looped = true
UnionSound.RollOffMaxDistance = 30
end
end
end
If anyone can help me with the tiny issue, that would be very much appreciated!
Thank you!