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

The lightsaber doesn't show up. I think this is the part where I'm going wrong. Any help?

Asked by
ZenTGE 4
6 years ago

local cf = CFrame.new local ang = CFrame.Angles local v3 = Vector3.new local rad = math.rad

local camera = workspace.CurrentCamera local render = game:GetService("RunService").RenderStepped local rstorage = game.ReplicatedStorage local sabersStorage = rstorage.SabersStorage local remotes = sabersStorage.Remotes local jointsRemote = remotes.Joints local takeDamage = remotes.TakeDamage local saberRemote = remotes.DoubleSaber1

local saberTab, saberModel, handlePart, handleWeld, bladePart1, bladePart2, hitBox1, hitBox2

local selected = false local activated = false local animating = false local throwing = false local secondSlash, secondSlashTime = false, 0 local colorNo1, colorNo2 = 1, 1

local holdHW = ang(rad(90), 0, 0) * cf(0, 0, 1)

local animate = {}

function updateWeld(weld) local prevParent = weld.Parent weld.Parent = nil weld.Parent = prevParent end

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago
local camera = workspace.CurrentCamera
local render = game:GetService("RunService").RenderStepped
local rstorage = game.ReplicatedStorage
local sabersStorage = rstorage.SabersStorage
local remotes = sabersStorage.Remotes
local jointsRemote = remotes.Joints
local takeDamage = remotes.TakeDamage
local saberRemote = remotes.DoubleSaber1

local saberTab, saberModel, handlePart, handleWeld, bladePart1, bladePart2, hitBox1, hitBox2

local selected = false
local activated = false
local animating = false
local throwing = false
local secondSlash, secondSlashTime = false, 0
local colorNo1, colorNo2 = 1, 1

function cf(a, b, c)
    return CFrame.new(a, b, c)
end
function ang(a, b, c)
    return CFrame.Angles(a, b, c)
end
function v3(a, b, c)
    return Vector3.new(a, b, c)
end
function rad(a)
    return math.rad(a)
end

local holdHW = ang(rad(90), 0, 0) * cf(0, 0, 1)

local animate = {}

function updateWeld(weld)
    local prevParent = weld.Parent
    weld.Parent = nil
    weld.Parent = prevParent
end

This should work. I replaced the first 4 variables with functions, and each one creates and returns a CFrame, angle, Vector3, or radius using the parameters you input. I believe what you had didn't work because you didn't have parenthesis after the .new, and because variables don't take input.

Also, you can check the output to see what's going wrong, and inform us what it says, as that should make life easier.

Ad

Answer this question