I keep getting this error and I dont know why I don care if you just give me the fix but I would prefer to know why its happening and how to fix it myself
local RE = game:GetService("ReplicatedStorage"):WaitForChild("RE")
RE.OnServerEvent:connect(function(player, request, data)
if request == "sprint" then
player.Character.Humanoid.WalkSpeed = data(1)
end
end)
heres the other part of the script in case its needed
local CAS = game:GetService("ContextActionService")
local RE = game:GetService("ReplicatedStorage"):WaitForChild("RE")
local fill = script.Parent:WaitForChild("Top"):WaitForChild("fill")
local stam = 50
local speed = 16
local function sprint(str, state, object)
speed = state == Enum.UserInputState.Begin and 24 or 16
RE:FireServer("sprint", (speed))
end
CAS:BindAction("sprint", sprint, true, Enum.KeyCode.LeftShift)