Hello Devs, I am working on a catching system and I wanted to use RenderStep inside of a serverscript. I want to make it so other players could also see your arms and others’ arms move. There is a slight problem with that. RenderStep can only be used in local scripts and I am looking for help to see if there’s a way around this. Please help.
Screenshot:
Server:
-- Services --
local Character = script.Parent
local Player = game:GetService('Players'):GetPlayerFromCharacter(Character)
local Replicated = game:GetService('ReplicatedStorage')
local Mouse = Player:GetMouse()
---
local CRem = Replicated.Remotes:WaitForChild('CRemote')
-- Values --
local CatchDebounce = false
local Football = nil
---
-- Functions --
local function TrackBall(Object)
for I,V in pairs(workspace:GetChildren()) do
if (V.Name == 'Football' and V:IsA('Part')) or (V.Name == 'Football' and V.Name == ('Handle')) then
Football = V
else
TrackBall(V)
end
end
end
---
CRem.OnServerEvent:Connect(function(Player, Action, ...)
local Char = Player.Character
if not Character:FindFirstChild('Football') then
local Instances = Character:WaitForChild( 'Instances' )
local RAWeld = Instance.new( 'Weld' )
local LAWeld = Instance.new( 'Weld' )
RAWeld.Name = 'RAW'
RAWeld.Part0 = Char.Torso
RAWeld.Part1 = Character['Right Arm']
RAWeld.Parent = Instances
LAWeld.Name = 'LAW'
LAWeld.Part0 = Char.Torso
LAWeld.Part1 = Character['Right Arm']
LAWeld.Parent = Instances
if not CatchDebounce then CatchDebounce = true end
local RunService = game:GetService('RunService')
local STime = os.time()
local Track
Track = RunService.RenderStepped:Connect(function()
local RCFrame = CFrame.new(Char.Torso.CFrame * Vector3.new(1.2, 1.1, 0), Mouse.Hit.Position) * CFrame.Angles(math.pi / 2, 0, 0)
local LCFrame = CFrame.new(Char.Torso.CFrame * Vector3.new(-1.2, 1.1, 0), Mouse.Hit.Position) * CFrame.Angles(math.pi / 2, 0, 0)
RAWeld.C0 = Char.Torso.CFrame:toObjectSpace(RCFrame) * CFrame.new(0, -.7, .6)
LAWeld.C0 = Char.Torso.CFrame:toObjectSpace(LCFrame) * CFrame.new(0, -.7, .6)
if os.time() - STime >= 3 then
Track:Disconnect()
RAWeld:Destroy()
LAWeld:Destroy()
if os.time() - STime >= 0.5 then
CatchDebounce = false
end
end
end)
end
end)
Client:
-- Instances --
local InputService = game:GetService('UserInputService')
local Player = game:GetService('Players').LocalPlayer
local Character = script.Parent.Parent
local Mouse = Player:GetMouse()
---
local CRem = game.ReplicatedStorage.Remotes:WaitForChild('CRemote')
-- Values --
local Football = game.ReplicatedStorage
---
-- Functions --
--local function TrackBall(Object)
-- for I,V in pairs(workspace:GetChildren()) do
-- if (V.Name == 'Football' and V:IsA('Part')) or (V.Name == 'Football' and V.Name == ('Handle')) then
-- Football = V
-- else
-- TrackBall(V)
-- end
-- end
--end
---
-- Work Remote --
InputService.InputBegan:Connect(function(Input,GPE)
if GPE then return end
local Type = Input.UserInputType
if Type == Enum.UserInputType.MouseButton1 then
--TrackBall()
--if Football ~= nil then
-- if Football:IsDescendantOf(game.Workspace) == true then
CRem:FireServer('Catch')
--end
--end
end
end)
---