#my abilities are lagging behind and idk why
1 messages · Page 1 of 1 (latest)
so how do i fix it?
send CFrame from client to server, ez fix
im new how would i do that?
🙂
dude i started last week💔
if you're trying to make a game like with many skills
use a module script
its just a test i didnt know id get this far honestly
and also, dont anchor on the client
try to already use a module script
its far easier
and its clean
idk even know what a module script does man💔
its like
a way of telling a script "ay bruh, give me the shi u got and lemme use it as mine"
so can i make like variables for all scripts to ascess?
** You are now Level 3! **
i see would this help my delay issue or is it just a tip?
as it will not work if u dont
both
the delay is prolly caused by the task.wait
how would i even migrate my script and how would i set it up even?
Balls
define the module
so
local module = {} -- < This comes preinstalled in the module itself
function module.HitboxCreation(player: Player)
-- < Your script here
end)
return module
on the server script u do:
local module = require(modulePath) -- < module path being the place that the module itself is in
Event.OnServerEvent:Connect(function(player)
module.HitboxCreation(player)
end)
this is the process
its easy
and clean
so id put this script in the first one?
okay so what script do i put in the module?
i would put a Module in the replicated storage and name it UserInputService
so the script i sent above?
yh
i would suggest using a module. something you would use across all the scripts
so
lemme pull up my studio
dude tysm i just get insulted for not knowing stuff your deadass so helpful
anytime
is a smile an insult
Is smiling an insult now
im not talking abt you ive met other people here
understandable
there, i fixed it
the script should look something like
the code to copy:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
for i, v in ReplicatedStorage:GetDescendants() do
if v:IsA("ModuleScript") then
require(v)
end
end
the module should look something like
-- // Service's
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(Input, gameProcessed)
if gameProcessed then return end
if Input then
end
end)
return {}
now u can check what input is being used
you need to keep the return {}
so i add that indo my module?
local module = {} -- < This comes preinstalled in the module itself
function module.HitboxCreation(player: Player)
local uis = game:GetService("UserInputService")
local replicatedstorage = game:GetService("ReplicatedStorage")
local event = replicatedstorage.remotes.attack
local player = game.Players.LocalPlayer
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Z then
local character = player.Character
if character and character:FindFirstChild("HumanoidRootPart") then
character.HumanoidRootPart.Anchored = true
end
event:FireServer()
print("fired")
end
end)
end
return module
brb
oaky
wait
lemme tweak it rq
-- // Service's
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- // Variables
local Event = ReplicatedStorage.remotes.attack
local player = game.Players.LocalPlayer
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent: boolean)
if gameProcessedEvent then return end
if input.KeyCode == Enum.KeyCode.Z then
local character = player.Character
if character and character:FindFirstChild("HumanoidRootPart") then
character.HumanoidRootPart.Anchored = true
end
Event:FireServer()
print("fired")
end
end)
return {}
use this
okay i added it
bet
so do i need to tweak my other script?
just copy mine and paste it in urs
okay
local ReplicatedStorage = game:GetService("ReplicatedStorage")
for i, v in ReplicatedStorage:GetDescendants() do
if v:IsA("ModuleScript") then
require(v)
end
end
so with this script is it already added or do i haev to add it somewhere?
okay i added it there
idk if we are done but i tested it and the delay is still there i was walking forward and im supposed to be in the middle
use a weld
so just weld it to the humanoidrootpart?
yh
if your still awake i took a break but how do you like get acsess to the variables in other scripts like you said you could do?
what variables?
you put the stuff u want to return in the table
** You are now Level 8! **
so i put the variables i want to use in other scripts in the return table?
** You are now Level 4! **