basicly what i want it to do is that if the player is at a certain speed or higher than the trails would enabled but it doesnt matter what speed the player is it just wont turn on

local rigType = script.Parent.Humanoid.RigType 
local char = script.Parent
function createTrail(attachment0, attachment1)
    local t = Instance.new("Trail", char)
    t.Attachment0 = attachment0
    t.Attachment1 = attachment1
if char.Humanoid.WalkSpeed >= 60 then
		t.Enabled = true
	else
		t.Enabled = false
	end
end
if rigType == Enum.HumanoidRigType.R15 then
    createTrail(script.Parent.LeftFoot.LeftAnkleRigAttachment, script.Parent.LeftUpperLeg.LeftKneeRigAttachment)
    createTrail(script.Parent.RightFoot.RightAnkleRigAttachment, script.Parent.RightUpperLeg.RightKneeRigAttachment)
end


4 comments

0

Do you receive any output from running this?

0

nope i received no output what so ever @MightyBaconOverlord

0

I'm assuming you are actually changing WalkSpeed to be >= 60. After doing this, are you disabling / reenabling the script? If not, your script will only run once immediately when the character loads.

0

Ooooooohhh that explains it, thanks @MightyBaconOverlord