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

Script to throw a block? Also for the block to appear above player head?

Asked by 5 years ago

Its just as the title says... How would I get a block to appear above a players head then have the player throw it on click? I have an animation for it too. That is what I have so far. But I cant get the block to appear above the player's head. It would also help if someone could tell me how to make them throw it. Thanks...

local Button = script.Parent

Button.MouseButton1Click:Connect(function()
    local Tool = game.Workspace.ThrowingBlock
    local Block = game.Workspace.ThrowingBlock.Handle
    local Clone = Tool:Clone()
    local player = game.Players.LocalPlayer
    local head = player.Character.Head
    Clone.Name = "ThrowingBlock Clone"
    Clone.Parent = game.Workspace

    local Tool = game.Workspace.ThrowingBlock
local Block = game.Workspace.ThrowingBlock.Handle
local Clone = Tool:Clone()
repeat wait() until player.Character.Humanoid
local humanoid = player.Character.Humanoid

Block.Position = head.Position + Vector3(0, 7.59, 0)

while true do
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/asset/?id=28604759" -- id of animation

    end
end)
1
Just so you know line 15 is unnecessary User#19524 175 — 5y
0
ik I left it in there on accident TheBlockBuilder89898 -10 — 5y

Answer this question