-
What do you want to achieve?
My grab/drop system is not working properly ANYMORE. I want that if you drop the meat part, it just lands on the ground like it always did. -
What is the issue?
It doesn’t land infront of you anymore, it seems like it flings with lightspeed into space. -
What solutions have you tried so far?
Okay so, I’ve been printing the magnitude between the humanoidrootpart and the meat to see if it is anywhere close, it’s around 17k studs away from the player model and I don’t even know how that is possible as it always worked, I never touched any scripts again since I finished this system. A few days back I testplayed and realized the dropping meat part is not working and I can’t seem to figure out what’s causing it. I’ve literally set the CFrame and position to the player’s paw but nothing helps at all…
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
My server script:
-----
local CanThrowBlock = false
local pickedup = game.ReplicatedStorage.Picked
local function Takeblock(plr, block)
local weld = Instance.new("Weld")
local char = plr.Character
local jaw = char:WaitForChild("Jaw")
-----
local humanoid = char:WaitForChild("Humanoid")
local Carnivore = humanoid:GetAttribute("Carnivore")
local Herbivore = humanoid:GetAttribute("Herbivore")
local Omnivore = humanoid:GetAttribute("Omnivore")
if Carnivore == true or Omnivore == true and pickedup.Value == false then
block.Anchored = false
weld.Parent = block
weld.Part0 = block
weld.Part1 = jaw
block.CFrame = char.Jaw.CFrame
weld.Name = "BlockWeld"
wait(1)
CanThrowBlock = true
pickedup.Value = true
end
---------
end
local function ThrowBlock(plr, block)
if CanThrowBlock == true and pickedup.Value == true then
local weld = block:WaitForChild("BlockWeld")
if weld:IsA("Weld") then
weld:Destroy()
block.CanCollide = false
wait(1)
block.Anchored = true
pickedup.Value = false
print(block.Position)
print((block.Position - plr.Character.HumanoidRootPart.Position).Magnitude)
end
end
CanThrowBlock = false
pickedup.Value = false
end
game.ReplicatedStorage.TakeBlock.OnServerEvent:Connect(Takeblock)
game.ReplicatedStorage.ThrowBlock.OnServerEvent:Connect(ThrowBlock)
My local script:
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharachterAdded:Wait()
local uis = game:GetService("UserInputService")
local hum = char:WaitForChild("Humanoid")
local CanGrabBlock = true
local function Block(plr, block)
if CanGrabBlock == true then
CanGrabBlock = false
game.ReplicatedStorage.TakeBlock:FireServer(plr, block)
uis.InputBegan:Connect(function(input, gameProcessedEvent)
if input.KeyCode == Enum.KeyCode.T then
game.ReplicatedStorage.ThrowBlock:FireServer(plr, block)
wait(1)
CanGrabBlock = true
end
end)
end
end
game.ReplicatedStorage.ClientBlock.OnClientEvent:Connect(Block)
And ofc the serverscript inside the meat:
script.Parent.ClickDetector.RightMouseClick:Connect(function(plr)
game.ReplicatedStorage.ClientBlock:FireClient(plr, script.Parent)
end)
Video for showcase of the problem, as you can see in the output the last value is magnitude and is really high for no reason. I expect it to be around 2-4