Hello,
I’m making a lightsaber customization system but when I try and change a model inside the tool everything messes up and I’m not sure where to start about fixing it…
Script:
local camera = game.Workspace.CurrentCamera
local saber = game.Players.LocalPlayer.Backpack.Saber
local hum = game.Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
local Model = saber.Handle.Hilt
local camView = game.Workspace.Cameras.LightsaberCustomizationCamera
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Visible = false
script.Parent.Parent.Parent.CustomizeSaber.ColorPurpleButton.Visible = true
script.Parent.Parent.Parent.CustomizeSaber.CloseButton.Visible = true
script.Parent.Parent.Parent.CustomizeSaber.ColorBlueButton.Visible = true
script.Parent.Parent.Parent.CustomizeSaber.ObiWanHiltButton.Visible = true
saber.Handle.Hilt.PrimaryPart = saber.Handle
camera.CameraType = "Scriptable"
camera.CFrame = camView.CFrame
--if saber.Equipped == true then
--saber.Equipped = false
saber:Clone()
saber.Parent = game.Workspace
Model:SetPrimaryPartCFrame(CFrame.new(-143.464, 27.816, 94.223))
saber.Handle.Anchored = true
--end
end)
-- Script that moves the hilt/handle
local obiWanHilt = game.ReplicatedStorage.SaberHilts["Obi-Wan Hilt"].Hilt
local saber = game.Workspace:WaitForChild("Saber")
local currentSaberHilt = saber.Handle.Hilt
script.Parent.MouseButton1Click:Connect(function()
obiWanHilt:Clone()
obiWanHilt.Parent = saber.Handle
currentSaberHilt:Destroy()
end)