Hi, I’m making an ice move, even tho this is like the 2nd thread, I’ve decided to post again since it’s a little itty bit different.
Script
return function(plr)
local tweenservice = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(0.35, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut)
local mouse = plr:GetMouse()
local mouseCF = mouse.Hit
local mousePos = Vector3.new(mouseCF.Position.X,plr.Character.HumanoidRootPart.Position.Y,mouseCF.Position.Z)
local start = plr.Character.HumanoidRootPart.CFrame
-- local goal = start.LookVector * 70
local spikesNum = math.random(4, 4)
local shardIncrements = 70 / spikesNum
for i = 1, spikesNum do
local newSpike = script.IceSpike:Clone()
local newplat = script.Platform:Clone()
newplat.Anchored = true
newplat.CanCollide = false
newSpike.Anchored = true
newSpike.CanCollide = true
local x, y, z = 20 * i, 1, 10 * i
newSpike.Size = Vector3.new(0, 0, 0)
newplat.Size = Vector3.new(0, 0, 0)
local pos = plr.Character.HumanoidRootPart.Position + start.LookVector * (shardIncrements * i)
local ori = plr.Character.HumanoidRootPart.Orientation
newSpike.Position = Vector3.new(pos.X, pos.Y + 5.25, pos.Z)
newplat.Position = Vector3.new(pos.X, pos.Y - 2.5, pos.Z)
newSpike.Orientation = plr.Character.HumanoidRootPart.Orientation + Vector3.new(0, 270, 0)
newplat.Orientation = plr.Character.HumanoidRootPart.Orientation + Vector3.new(0, 270, 0)
local newsizeplat = Vector3.new(20 * i, 4, 20 * i)
local newposplat = newplat.Position
local newPos = newSpike.Position
local newSize = Vector3.new(19 * i, 15 * i, 17 * i)
local tween = tweenservice:Create(newSpike, tweeninfo, {Size = newSize, Position = newPos})
local plattween = tweenservice:Create(newplat, tweeninfo, {Size = newsizeplat, Position = newposplat})
newplat.Parent = workspace.Effects
newSpike.Parent = workspace.Effects
tween:Play()
plattween:Play()
local parts = workspace:GetPartsInPart(newSpike)
--[[ if parts:IsA("BasePart") then
if parts.Parent:IsA("Model") then
if parts.Parent["Humanoid"] then
local hum = parts.Parent:WaitForChild("Humanoid")
hum:TakeDamage(30)
end
end
end --]]
coroutine.resume(coroutine.create(function()
wait(3)
local reverseTween = tweenservice:Create(newSpike, tweeninfo, {Size = Vector3.new(0, 0, 0), Position = Vector3.new(pos.X, 0, pos.Z)})
local reverseTween2 = tweenservice:Create(newplat, tweeninfo, {Size = Vector3.new(0, 0, 0), Position = Vector3.new(pos.X, 0, pos.Z)})
reverseTween:Play()
wait(0.35)
reverseTween2:Play()
reverseTween.Completed:Wait()
newSpike:Destroy()
reverseTween2.Completed:Wait()
end))
wait(math.random(1, 100)/1000)
end
plr.Busy.Value = false
print("z move done!")
end
The one I’m stuck on is: local newSize = Vector3.new(19 * i, 15 * i, 17 * i)
I want it so it increases the Y axis on top, not below.
The arrows indicate where it’s increasing, it increases depending on which spike, for example 1 is the normal sized one, 2 is fairly higher, and so on. I’d love some help, thank you.