It’s hard to explain but my issue is that I was thinking if it was possible to replace _canDive with the Stat value, i’m quite unsure on how to do this.
What is the Stat value? How are you firing this event?
If the rest of your code looks like this there is no reason it won’t work, but we would more information.
checkStat.Event:Connect(function(Stat)
if Stat then
end
end)
checkStat:Fire(true)
Also you can paste code blocks with three back ticks like so
```
– past code here
function()
end
```
Pretty much, I had a module script and I was wondering if it were possible to sort of get something from the module script without needing to be specific.
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local UIS = game:GetService("UserInputService")
local core = game.ReplicatedStorage:WaitForChild("CustomMovement");
local utility = core:WaitForChild("Utility");
local uisBinds = require(utility:WaitForChild("UserInputBind"));
local moveSet = require(core:WaitForChild("MoveSet")).new(game.Players.LocalPlayer);
--
local P_Abilities = Player:WaitForChild("PlayerAbilities")
local checkStat = game:GetService("ReplicatedStorage"):WaitForChild("Remotes").CheckStat
checkStat.Event:Connect(function(Stat)
if Stat then
end
end)
if P_Abilities:FindFirstChild("CanTripleJump").Value == true then
moveSet.maxJumps = 3
else
moveSet.maxJumps = 2
end
local function slowFall(actionName, userInputState, input)
moveSet:setSlowFall(userInputState == Enum.UserInputState.Begin)
return Enum.ContextActionResult.Pass;
end
local function dive(actionName, userInputState, input)
if (userInputState == Enum.UserInputState.Begin) then
moveSet:dive();
end
return Enum.ContextActionResult.Pass;
end
local function crouchHold(actionName, userInputState, input)
moveSet:setCrouch(userInputState == Enum.UserInputState.Begin);
return Enum.ContextActionResult.Pass;
end
local function crouchToggle(actionName, userInputState, input)
if (userInputState == Enum.UserInputState.Begin) then
moveSet:setCrouch(not moveSet:isCrouching());
end
return Enum.ContextActionResult.Pass;
end
--
--moveSet.isLookingAt = false;
uisBinds:BindToInput("dive", dive, Enum.KeyCode.LeftShift, Enum.KeyCode.ButtonX);
uisBinds:BindToInput("slowFall", slowFall, Enum.KeyCode.Space, Enum.KeyCode.ButtonA);
uisBinds:BindToInput("crouchHold", crouchHold, Enum.KeyCode.ButtonL2, Enum.KeyCode.LeftControl);
--uisBinds:BindToInput("crouchToggle", crouchToggle, Enum.KeyCode.LeftControl);
UIS.JumpRequest:Connect(function()
moveSet:onJumpRequest(Character);
end)
game:GetService("RunService"):BindToRenderStep("MoveSet", Enum.RenderPriority.Input.Value, function(dt)
moveSet:update(dt);
end)