Ive Tried Multiple Times To Get This Working I tried a Capsule And A Floating Camera and I've Had A Problem With Both.
First The Camera, When I Hold W & A I Would Move Diagonally but if i let go of Either Of The Keys I Would Stop Completely. I Deleted This Code So I Cant Show It.
And For The Capsule I Tried To Make It Jump Using Remote Events But Nothing Would Work. Server Script Inside The Capsule:
local FloorTouched = false
while wait() do
local Player = game.Players:FindFirstChild(script.Parent.Name)
script.Parent.FloorDetection.Touched:Connect(function()
script.Parent.FloorDetection.Color = script.Green.Value
FloorTouched = true
end)
if FloorTouched == true and not script.Parent.FloorDetection.Touched then
script.Parent.FloorDetection.Color = script.Red.Value
FloorTouched = false
end
end
game.ReplicatedStorage.Controller.OnServerEvent:Connect(function(player,Key)
if Key == "Jump" and FloorTouched == true then
print(Key)
script.Parent.Root.Velocity = Vector3.new(0,50,0)
end
end)
and Local Script In The Starter Player:
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(input)
local Key
if input.KeyCode == Enum.KeyCode.Space then
print("Space Was Pressed")
Key = "Jump"
game.ReplicatedStorage.Controller:FireServer(Key)
end
end)
