i have a script that makes a trail when you walk or jump, is it possible to create 60 blocks per second instead of 30?
script
local plr = game:GetService("Players").LocalPlayer
local userinput = game:GetService("UserInputService")
local rp = game:GetService("ReplicatedStorage")
local movedval = script:WaitForChild("moved")
while not plr.Character do
wait()
end
local char = plr.Character
local nameadder = 1
local hum = char:WaitForChild("Humanoid")
userinput.InputBegan:Connect(function(inp, ga)
if inp.KeyCode == Enum.KeyCode.W then
movedval:FindFirstChild("W").Value = true
elseif inp.KeyCode == Enum.KeyCode.A then
movedval:FindFirstChild("A").Value = true
elseif inp.KeyCode == Enum.KeyCode.S then
movedval:FindFirstChild("S").Value = true
elseif inp.KeyCode == Enum.KeyCode.D then
movedval:FindFirstChild("D").Value = true
elseif inp.KeyCode == Enum.KeyCode.Space then
movedval:FindFirstChild("Space").Value = true
end
end)
userinput.InputEnded:Connect(function(inp, ga)
if inp.KeyCode == Enum.KeyCode.W then
movedval:FindFirstChild("W").Value = false
elseif inp.KeyCode == Enum.KeyCode.A then
movedval:FindFirstChild("A").Value = false
elseif inp.KeyCode == Enum.KeyCode.S then
movedval:FindFirstChild("S").Value = false
elseif inp.KeyCode == Enum.KeyCode.D then
movedval:FindFirstChild("D").Value = false
elseif inp.KeyCode == Enum.KeyCode.Space then
movedval:FindFirstChild("Space").Value = false
end
end)
for _, v in ipairs(movedval:GetChildren()) do
v:GetPropertyChangedSignal("Value"):Connect(function()
if movedval.W.Value == true or movedval.A.Value == true or movedval.S.Value == true or movedval.D.Value == true or movedval.Space.Value == true then
movedval.Value = true
else
movedval.Value = false
end
end)
end
local fold = game.Workspace:WaitForChild("cp's")
while true do
wait(1 / rp:WaitForChild("cps").Value)
if movedval.Value == true and rp:WaitForChild("trailon").Value == true then
local trail = Instance.new("Part", fold)
trail.Name = tostring(nameadder)
trail.CFrame = char:FindFirstChild("Torso").CFrame
trail.Transparency = 0.75
trail.Size = Vector3.new(2, 2, 1)
trail.Color = Color3.new(1,0,0)
trail.Anchored = true
trail.CanCollide = false
trail.Material = Enum.Material.SmoothPlastic
nameadder = nameadder + 1
end
end