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

How do I make this do damage when an enemy touches the part named "SandPool"?

Asked by 7 years ago

--Title says it all

Player = script.Parent.Parent
Char = Player.Character
mouse = Player:GetMouse()


function keydown(key)   
    key:lower()
    if key == "v" then
        SandPool = Instance.new("Part")
        SandPool.Parent = Char["Torso"]
        SandPool.CFrame = CFrame.new(Char["Right Leg"].Position)
        SandPool.Size = Vector3.new(1,.2,1)
        SandPool.BrickColor = BrickColor.new("Daisy orange")
        SandPool.Name = "SP"
        SandPlate = Instance.new("CylinderMesh")
        SandPlate.Parent = SandPool
            game:GetService("Chat"):Chat(Player.Character.Head, "Sand Pool!")
    SandPool.Anchored = true
    Char["Right Leg"].Transparency = 1
        Char["Left Leg"].Transparency = 1

        for i = 1,10 do
            SandPool.Size = SandPool.Size+Vector3.new(3,0,3)
            wait(.1)
        end

        for i = 1,10 do
            SandPool.Size = SandPool.Size+Vector3.new(-3,0,-3)
            wait(.1)
        Char["Right Leg"].Transparency = 0
        Char["Left Leg"].Transparency = 0

    end
    end
    end


mouse.KeyDown:connect(keydown)

1 answer

Log in to vote
0
Answered by
sammiya1 134
7 years ago
-- I put this stuff here to show just where the Sound is located
wait(34)
Song = game.Workspace.PickAToonSongs
Song.Volume = 1
Song.Looped = true


Assets = {253943659,392883743}
for _, asset in ipairs(Assets) do
game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=" .. asset)
end


Song.SoundId = "rbxassetid://" ..Assets[math.random(1,#Assets)] --'http://www.roblox.com/asset/?id=' can also be used.
Song:Play()

Ad

Answer this question