I am making a JoJo’s Bizarre Adventure of game and when I use the local function, I get this same error every time
(ServerScriptService.Abilities.Humanoid.R6.Skills.Summon:22: attempt to index boolean with ‘Character’)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local Modules = ReplicatedStorage.Modules
local Remotes = ReplicatedStorage.Remotes
local StandRemotes = Remotes.Abilities.R6
local SummonRemote = Remotes.Abilities.R6.Summon
local Effects = ReplicatedStorage.Effects
local Sounds = ReplicatedStorage.Sounds
local Animations = ReplicatedStorage.Animations
local StandSounds = Sounds.Abilities.R6
local PlayerAnimations = Animations.Abilities.R6.Player
local StandAnimations = Animations.Abilities.R6.Stand
local Models = ServerStorage.Models
local StandModel = Models.Abilities.Humanoid.R6
local function Summon(Player)
local Character = Player.Character
if not Character then
return
end
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local Stand = StandModel:Clone()
local StandRoot = Stand.PrimaryPart
StandRoot.CFrame = HumanoidRootPart.CFrame * CFrame.new(2, -1, -2)
local Weld = Instance.new("Weld")
Weld.Part0 = HumanoidRootPart
Weld.Part1 = StandRoot
Weld.C1 = CFrame.new(2, -1, -2)
Weld.Parent = HumanoidRootPart
Stand.Parent = Character
end
SummonRemote.OnServerEvent:Connect(function(Debounce, Player)
print("Working Checked")
Summon(Player)
end)