local remote = script.Parent
remote.OnServerEvent:Connect(function(Player, Action)
if Action == "lol" then --the action is lol in the local script
local Char = Player.Character
local hum = Char:WaitForChild("Humanoid")
local hr = Char:WaitForChild("HumanoidRootPart")
local bd = Instance.new("BodyPosition",hr)
local pos = hr.CFrame * CFrame.new(1,0,0)
bd = pos.p
end
end)
local remote = script:WaitForChild("RemoteEvent")
local Uis = game:GetService("UserInputService")
Uis.InputBegan:Connect(function(Input,IsTyping)
if IsTyping then return end
if Input.KeyCode == Enum.KeyCode.E then
remote:FireServer()
end
end)
normal script:
local remote = script.Parent
remote.OnServerEvent:Connect(function(Player)
local Char = Player.Character
local hum = Char:WaitForChild("Humanoid")
local hr = Char:WaitForChild("HumanoidRootPart")
local bd = Instance.new("BodyPosition",hr)
local pos = hr.CFrame * CFrame.new(0,0,1)
bd = pos.Position
end)