I made this weird Ice power thingy but whenever IceSpike gets touched it doesnt really work well..


local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Tool = script.Parent
local Handle = Tool.Handle
local IceParticle = Handle.IceParticle
Mouse.TargetFilter = Player.Character

Tool.Activated:connect(function()
local IceSpike = Instance.new('Part', game.Workspace)
IceParticle:Clone().Parent = IceSpike
IceSpike.Size = Vector3.new(.2, .2, 2)
IceSpike.Anchored = false
IceSpike.CanCollide = false
IceSpike.BrickColor = BrickColor.new('Baby blue')
IceSpike.CFrame = Tool.Handle.CFrame
IceSpike.CFrame = CFrame.new(IceSpike.Position,Mouse.Hit.p)
local BodyVelocity = Instance.new('BodyVelocity',IceSpike)
BodyVelocity.Velocity = IceSpike.CFrame.lookVector *300
BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
IceSpike.Touched:connect(function()
IceSpike.Anchored = true
end)
end)

2 comments

0

explain a little bit more: How does the IceSpike not work?

0

Basically it shoots this ice spike (Part) to where the mouse is and when it hits it gets anchored and stops from moving