#Character is not a valid member of Model "Workspace.Rig"
1 messages · Page 1 of 1 (latest)
script.Parent is the character in this case no? assuming the error is happening in the highlighed script
yea
so the problem is that there is no object name Character in the rig model
no object named character?
yes, player.Character only works if player is a player object, which in this case isnt, its a model
in this case it is looking for an object named Character
which it cant find, so it gives an error
you already have the model of the rig using script.Parent, you dont need to do anything else
or is there something else you're trying to do?
lemme give you the whole script
local AttributeRF = game.ReplicatedStorage.StateManager:FindFirstChild("SetAttributeRF")
local stateManager = require(game.ReplicatedStorage.StateManager)
local parryDuration = 1
local plr = script.Parent
while(true) do
print("Rig Parry")
stateManager.SetState(plr, "Parrying", true, parryDuration)
local char = plr.Character
local hum = char:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")
local parryAnim = game.ReplicatedStorage.Animations:FindFirstChild("Parry")
local parryTrack = animator:LoadAnimation(parryAnim)
local parryDuration = 1
parryTrack:Play()
parryTrack:GetMarkerReachedSignal("Pause"):Connect(function()
parryTrack:AdjustSpeed(0)
end)
task.wait(1)
parryTrack:Stop()
task.wait(parryDuration)
end
so its running on a while loop
in the loop it grabs the character and humanoid to make an animator
actually i should put those out of the while loop but ill do that later
and im setting a parry state so it can be detected if its parrying in other scripts
just change
local char = plr.Character
to
local char = script.Parent
oh okay
again your character in this case is just script.Parent