|
local brick = game.Workspace.Brick
brick.BrickColor = BrickColor.new("Brown")
function onTouch(part)
brick.instance.new("Sound")
wait(1)
brick.Sound.Content = ("http://www.roblox.com/Asset/?id=130833677")
brick.Sound:play()
print("*poot*")
end
the first 2 lines work, but the function doesn't |
|
|
oh whoops forget the connect >.< |
|
litalelaJoin Date: 2010-03-30 Post Count: 6267 |
local brick = game.Workspace.Brick -- would be better to put in brick and do script.Parent
brick.BrickColor = BrickColor.new("Brown")
brick.Touched:connect(function(hit)
local sound = Instance.new("Sound", brick)
wait(1)
sound.SoundId = "http://www.roblox.com/Asset/?id=130833677"
sound:Play()
end)
|
|
|
local brick = game.Workspace.Brick
local debounce = false
brick.BrickColor = BrickColor.new("Brown") --[[Move this to after your function if you want it to change after being touched otherwise it will when the server runs.]]--
script.Parent.Touched:connect(function(part)
if debounce == false then
debounce = true
brick.instance.new("Sound")
wait(1)
brick.Sound.Content = ("http://www.roblox.com/Asset/?id=130833677")
brick.Sound:play()
print("*poot*")
end
debounce = false
end)
|
|
|
If this script is in workspace use this
local b = game.Workspace.Brick -- What you define after local could be as short as b
local debounce = false
brick.BrickColor = BrickColor.new("Brown") --[[Move this to after your function if you want it to change after being touched otherwise it will when the server runs.]]--
b.Touched:connect(function(part)
if debounce == false then
debounce = true
brick.instance.new("Sound")
wait(1)
brick.Sound.Content = ("http://www.roblox.com/Asset/?id=130833677")
brick.Sound:play()
print("*poot*")
end
debounce = false
end)
|
|
|
i got it myself already but thanks anyway guys |
|