Hi, i need to make a part to follow my character (under it) but i need that part to always stay on ground so it needs to follow my character movement but at the same time it needs to stay stick to ground even if i jump or fly that is why i cant use weld or motor i tried doing it with heartbeat but its so slow and not real time what is the easy way for this?
#Hello, can someone help me with a script?
1 messages · Page 1 of 1 (latest)
im not asking for a script i need to learn the method to make the script by myself
read my text before replying pls
like this?
** You are now Level 15! **
you said this, so I though u want someone to make script for you
yea you used heartbeat probably but i need it without the latency
Maybe do client prediction and then server replication?
because i know some people will just say use renderstepped or something
i need to clarify
hm?
Use render stepped on client and replicate part position on server
with remote events?
yeah
wouldnt that cause lag if there is multiple players?
im not a pro with remoteevents
wow
did you get the same errors? it works fine at start but im getting these errors after 20-30 seconds
show me ur code
local or server
1sec i need to translate to english first i was using my language
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage:WaitForChild("partposevent")
local auras = {}
remote.OnServerEvent:Connect(function(player, pos)
local char = player.Character
if not char then return end
local aura = auras[player]
if not aura then
aura = ReplicatedStorage:WaitForChild("aura"):Clone()
aura.Anchored = true
aura.CanCollide = false
aura.Parent = workspace
auras[player] = aura
end
aura.Position = pos
end)
this is the server one
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local root = character:WaitForChild("HumanoidRootPart")
local aura = game.Workspace:FindFirstChild("aura")
aura.Anchored = true
aura.CanCollide = false
aura.Parent = workspace
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Blacklist
params.FilterDescendantsInstances = {character}
local event = ReplicatedStorage:WaitForChild("partposevent")
RunService.RenderStepped:Connect(function()
local origin = root.Position + Vector3.new(0, -2, 0)
local result = workspace:Raycast(origin, Vector3.new(0, -100, 0), params)
if result then
local pos = result.Position + Vector3.new(0, aura.Size.Y/2, 0)
aura.Position = pos
aura.CFrame = CFrame.new(pos) * CFrame.Angles(math.pi/2, 0, 0)
end
end)
local last = 0
RunService.Heartbeat:Connect(function()
if tick() - last < 0.1 then return end
last = tick()
event:FireServer(aura.Position)
end)
** You are now Level 7! **
this is the local
```lua
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage:WaitForChild("partposevent")
local auras = {}
remote.OnServerEvent:Connect(function(player, pos)
local char = player.Character
if not char then return end
local aura = auras[player]
if not aura then
aura = ReplicatedStorage:WaitForChild("aura"):Clone()
aura.Anchored = true
aura.CanCollide = false
aura.Parent = workspace
auras[player] = aura
end
aura.Position = pos
end)
```lua
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local root = character:WaitForChild("HumanoidRootPart")
local aura = game.Workspace:FindFirstChild("aura")
aura.Anchored = true
aura.CanCollide = false
aura.Parent = workspace
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Blacklist
params.FilterDescendantsInstances = {character}
local event = ReplicatedStorage:WaitForChild("partposevent")
RunService.RenderStepped:Connect(function()
local origin = root.Position + Vector3.new(0, -2, 0)
local result = workspace:Raycast(origin, Vector3.new(0, -100, 0), params)
if result then
local pos = result.Position + Vector3.new(0, aura.Size.Y/2, 0)
aura.Position = pos
aura.CFrame = CFrame.new(pos) * CFrame.Angles(math.pi/2, 0, 0)
end
end)
local last = 0
RunService.Heartbeat:Connect(function()
if tick() - last < 0.1 then return end
last = tick()
event:FireServer(aura.Position)
end)
i get more errors if i try to lower the remoteevent ms
You used ai for this, right?
yea i dont know about positions and predictions
You created remote event in replicated storage?
yes its there
can you show other errors u getting
its the same error but the number multiplying i think its because there is too many remoteevent sendings no?
try putting local script in starter character scripts
okay