I am trying to recreate muddy heights and I got far enough but I am missing a vital physic of the game! Controlling the poop.
I have this right now but it doesn’t seem to work, I can’t move it at all.
(LocalScript inside StarterGui)
local player = game:GetService("Players").LocalPlayer
local playerName = player.Name
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input)
local CalledPoop = playerName.."_Poop"
if input.KeyCode == Enum.KeyCode.W and game.Workspace:WaitForChild(CalledPoop) then
print("W pressed and Poop is in workspace")
for _, v in pairs(game.Workspace:WaitForChild(CalledPoop):GetChildren()) do
if v:IsA("Part") then
v:ApplyImpulse(Vector3.new(-3,0,0))
end
end
end
end)
and then I also have this
(Script in ServerScriptService)
local MakePoop = game:GetService("ReplicatedStorage"):WaitForChild("MakePoop")
local ChangeCam = game:GetService("ReplicatedStorage"):WaitForChild("ChangeCam")
local Poop = game:GetService("ReplicatedStorage"):WaitForChild("Poop")
local HideUI = game:GetService("ReplicatedStorage"):WaitForChild("HideUI")
local IsPoopThere = false
MakePoop.OnServerEvent:Connect(function(player)
if not IsPoopThere then
IsPoopThere = true
local playersPoop = Poop:Clone()
playersPoop.Name = tostring(player.Name).."_Poop"
playersPoop.Parent = game.Workspace
ChangeCam:FireClient(player, playersPoop.CamPart)
for _, v in pairs(playersPoop:GetChildren()) do
if v:IsA("Part") then
v:ApplyImpulse(Vector3.new(-3,0,0))
end
end
elseif IsPoopThere then
print("Poop is already made")
end
end)
Video