#rig behaves weirdly
1 messages · Page 1 of 1 (latest)
i dont understand a thing 😭
u are tring to make enemies follow you
welp lets wait for oters
yeah
** You are now Level 8! **
:MoveTo() makes a humanoid follow u
but for some reason it dosent work because idk
you know 1/60 is 0.0166666666666667 right ?
does it lag if its a lot of numbers or smth
nope
No
Im kinda curious to why you would even use remote-event for chasing part 
u help 😭
fr 😭
what is hit ?
wait
😭
mb
Hit?
the remote event receives hit
It could be a string/bool and Instance
You can actually name "hit" anything
i see
** You are now Level 1! **
nope
** You are now Level 2! **
you need the remote, actually
how
For?
💀
You can just do this
workspace["YourPart"].Touched:Connect(function(Hit_)
if Hit_:IsA("BasePart") then
warn(Hit_.Name)
end
end)
lol
wouldnt that fire for everyone if someone touches it
Well yeah, but if you want it to be client side you'll need to set up a local script
Using remote event
yeah i wanted the thing to be local
hmm i see
😭
I mean i think i can set up a basic script for local script
wdym
is the remote event being called alot of time
hmmmmmm lemme check
oh yep
lemme try to fix that rq
and you're using while loops in event callback
** You are now Level 8! **
yea
do it separately
wdym
while loop outside the event, use what i call it "activation/deactivation flag" by using boolean
variable = boolean
when the event is fired, it sets a variable to true then the while loop can run
oh yeah forgot i already fixed the remote being called multiple times
but like
it works
but very weirdly
lemme show a video
so yeah basically it works when it wants it to
the video is loading wait a second
make it embed to discord
@ebon vortex
-- Server
ocal ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChasingScript = ReplicatedStorage:FindFirstChild("ChasingScript", true)
local PartTouch = workspace:WaitForChild("YourPart") -- Replace "YourPart" with the name of the part that you planned to trigger the "Chase" with
if not ChasingScript then
return warn("ChasingScript[1]", "does not exist.")
end
local ChasingScript1 = ChasingScript:FindFirstChild("ChaseScript1", true)
if not ChasingScript1 then
return warn("ChasingScript[2]", "does not exist.")
end
function OnTouch(Hit)
local Player = game:GetService("Players"):GetPlayerFromCharacter(Hit.Parent)
if Player then
ChasingScript1:FireClient(Player, "EpicChase")
end
end
if not PartTouch then
PartTouch = Instance.new("Part", workspace)
PartTouch.Position = Vector3.new(0, 50, 0)
end
PartTouch.Touched:Connect(OnTouch)
Client:
local Workspace = game:GetService("Workspace")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer or Players.PlayerAdded:Wait()
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local Root = Character:WaitForChild("HumanoidRootPart")
-- ChasingScript
local ChasingScript = ReplicatedStorage:FindFirstChild("ChasingScript", true)
if not ChasingScript then
return warn("ChasingScript does not exist.")
end
local ChasingScript1 = ChasingScript:FindFirstChild("ChaseScript1", true)
if not ChasingScript1 then
return warn("ChasingScript1 does not exist.")
end
-- Event for handling chasing logic
function CE_Event(Action)
if Action == "EpicChase" then
local Enemi = Workspace:FindFirstChild("enemi")
if not Enemi or not Enemi:FindFirstChild("HumanoidRootPart") or not Enemi:FindFirstChild("EpicHumanoid") then
return
end
local EnemiRoot = Enemi:FindFirstChild("HumanoidRootPart")
local EpicHumanoid = Enemi:FindFirstChild("EpicHumanoid")
local StopDistance = 5 -- Distance at which the Enemi stops chasing :3
local function ChasePlayer()
local direction = (Root.Position - EnemiRoot.Position).unit
local Distance = (Root.Position - EnemiRoot.Position).magnitude
if Distance > StopDistance then
-- Move the Enemi towards the player!!!
EpicHumanoid:MoveTo(Root.Position)
else
return
end
end
-- Start chasing
RunService.Heartbeat:Connect(ChasePlayer)
end
end
-- Listening for the event
ChasingScript1.OnClientEvent:Connect(CE_Event)
yes i rewrited your code 💀
It took a while
👍
dont spoonfeed
and for gods sake just use pathfinding
Yes
** You are now Level 3! **
Pathfinding
also, youre either shit at coding and need to boot a tutorial or this is ai
Fr
Instance making the part , looks AI lol
It aint ai 💀
I said simple for a reason!!!
nobody makes 2 variables just to check if a single part exists...
Im just tryna to help luis
well youre doing it extremely wrong
- Youre spoonfeeding him
- Youre spoonfeeding him bullshit
What was the issues? tho
I don't wanna argue so ima just read lol
Too many if?
no too many problems and issues
For being helper you're not pointing out the issues to my code 💀
** You are now Level 2! **
Thanks mee6 🔥
i dont have to, thats not what helper is even for
try to learn and then come back to it
youll see whats wrong
unless you didnt make it
but an autonomous algorythm
I made it tho, That's just my style of coding 😔
anyway, pointless argument. No spoonfeeding and @ebon vortex use pathfinding
learn it
use it
no gpt or else youre fucking urself
PathfindingService?
then sorry bro but you threw being efficient, optimal and reservant of memory out the window
yes
Oohh, so thats the problem 💀
Memory leak is about to go crazy
I like reading bullshit chats
Everything is bullshit mate
if you want to continue it like this go to #💬︱general
What @median galleon says are facts
@ebon vortex