|
if console.Text:sub(1, 6) == "music/" then
local musicId = console.Text:sub(7)
local music = Instance.new("Sound", game.Workspace)
music.SoundId = ("http://www.roblox.com/asset/?id=" .. musicId)
music.Looped = true
music:Play()
end
I don't know how to fix this.
-i am atlanticblox |
|
VulneriteJoin Date: 2007-11-05 Post Count: 11492 |
Any output?
And what's the problem with it |
|
|
I'm making a command bar made for personal servers and games.
Currently that script has no errors as rblx.lua says.
So, whenever I go in-game and type in: music/142303063
and press execute, I wait for a while since big sounds take a while to load and nothing happens.
-i am atlanticblox |
|
VulneriteJoin Date: 2007-11-05 Post Count: 11492 |
What I do is inbetween aeach statement
print'a'
then
print'b'
etc
to figure out how far it gets
helps a lot with debugging |
|
|
I used my logic and did this:
if console.Text:sub(1, 6) == "music/" then
local musicId = console.Text:sub(7)
local music = Instance.new("Sound", game.Workspace)
music.SoundId:sub(1, 32)
music.SoundId:sub(33, musicId)
print(music.SoundId)
music.Looped = true
music:Play()
end
But, when I go in-game and type in: music/142303063
Nothing prints out in the developer console.
-i am atlanticblox |
|
VulneriteJoin Date: 2007-11-05 Post Count: 11492 |
music.SoundId:sub(1, 32)
music.SoundId:sub(33, musicId)
print(music.SoundId) |
|
|
I went to play solo to type in: music/142303063 and I didn't see an instance of Sound under Workspace.
What am I doing wrong. o_O
if console.Text:sub(1, 6) == "music/" then
local musicId = console.Text:sub(7)
local music = Instance.new("Sound", game.Workspace)
music.SoundId:sub(1, 32)
music.SoundId:sub(33, 50, musicId)
print(music.SoundId)
music.Looped = true
music:Play()
end
-i am atlanticblox |
|
VulneriteJoin Date: 2007-11-05 Post Count: 11492 |
Did you check the console script |
|
|
This is the whole script btw:
console = script.Parent.Parent.Parent.FrameOne.TextBox
admin = "Player1"
name = game.Players.LocalPlayer
function findPlayer(name)
for _, player in pairs(game.Players:GetPlayers()) do
if player.Name:lower() == name:lower() then
return player
end
end
end
function button()
for _,v in pairs(game.Players:GetChildren()) do
if v.Name == admin then
local code = console.Text
wait()
if console.Text:sub(1, 3) == "ff/" then
local victim = findPlayer(console.Text:sub(4))
if victim and victim.Character then
Instance.new("ForceField", victim.Character)
end
elseif console.Text:sub(1, 4) == "god/" then
local victim = findPlayer(console.Text:sub(5))
if victim and victim.Character then
victim.Character.Humanoid.MaxHealth = math.huge
end
elseif console.Text == "tp" then
for i,x in pairs(game.Players:GetChildren()) do
if x.Name ~= admin then
x.Character.Torso.CFrame = CFrame.new(v.Torso.CFrame)
end
end
elseif console.Text == "shine" then
for _, char in pairs(v.Character:GetChildren()) do
if char:IsA("Hat") then
char:Destroy()
end
if char:IsA("Pants") and char:IsA("Shirt") then
char:Destroy()
else print'false'
end
if char:IsA("Part") then
Instance.new("Sparkles", char)
char.Reflectance = 0.666
char.BrickColor = BrickColor.new("Bright Yellow")
end
end
elseif console.Text:sub(1, 5) == "unff/" then
local victim = findPlayer(console.Text:sub(6))
if victim and victim.Character then
for _, char in pairs(victim.Character:GetChildren()) do
if char:IsA("ForceField") then
char:Destroy()
end
end
end
end
if console.Text == ("kill") then
v.Character:BreakJoints()
end
if console.Text:sub(1,5) == "fire/" then
local victim = findPlayer(console.Text:sub(6))
if victim and victim.Character then
for _= 1, 2 do
Instance.new("Fire", victim.Character.Torso)
end
end
if console.Text:sub(1, 6) == "music/" then
local musicId = console.Text:sub(7)
local music = Instance.new("Sound", game.Workspace)
music.SoundId:sub(1, 32)
music.SoundId:sub(33, 50, musicId)
print(music.SoundId)
music.Looped = true
music:Play()
end
script.Parent.Parent.Parent.FrameOne.TextBox.Text = ""
end
end
end
end
script.Parent.MouseButton1Down:connect(button)
Why isn't this working!
-i am atlanticblox |
|
|
ugh, why did i write: Why isn't it working!
Maybe I was referring to the music/ one.
everything else works.
-i am atlanticblox |
|
VulneriteJoin Date: 2007-11-05 Post Count: 11492 |
it's 4:00 AM I'm not thinking properly will reply tomorrow
I made 3 stupid scripting errors around this time today so ya
night |
|
|
omg, you stayed up all night just like I did last night.
lol. coincidence.
-i am atlanticblox |
|
|
i really hate it when no one is on.
-i am atlanticblox |
|
|
|
|
|
|
|
B6, CAN SOMEONE PLEASE, FIX THIS, PLEASE!
-i am atlanticblox |
|
|
|
b8. . .
-i am atlanticblox |
|
|
|
|
B11. . .
-i am atlanticblox |
|
|
B12 . . . it seems like 5 years since the last reply.
-i am atlanticblox |
|