Hi guys! So these days i experienced something weird and i was wondering if it is me doing something wrong or a glitch from roblox. I used tools so many times now and i really doubt i did a stupid mistake (but we never know). The first problem was with a meat system. Eating it would make you fat. More meat mean more fatness. For a while it was working perfectly then suddenly the tool stopped working without any errors (i did not even modify the meat tool nor the local or server script). But then the problem got fixed by itself without any particular reason. Today i face the same problem! so basically i use a remote event between my local script on the tool and my server script on ServerScriptService. The fact is earlier it was working! Now, when i use the tool, the printing message “Working” doesn’t even appear. So yeah, i will post my scripts because this is what we do when we ask for help.
Here we go:
LOCAL SCRIPT
wait(0.5) local tool = script.Parent local plr = script.Parent.Parent local InUse = false local InUse2 = false local remote = game.ReplicatedStorage:WaitForChild("ile") if plr:FindFirstChild("Humanoid") then local anim1 = Instance.new("Animation") anim1.AnimationId = "rbxassetid://6478922411" local handle = plr:FindFirstChild("Humanoid"):LoadAnimation(anim1) tool.Activated:Connect(function() if not InUse then InUse = true remote:FireServer("Sonar", tool) wait(3) InUse = false end end) tool.Deactivated:Connect(function() handle:Stop() end) tool.Unequipped:Connect(function() handle:Stop() end) end
SERVER SCRIPT
game.ReplicatedStorage:WaitForChild(“ile”).OnServerEvent:Connect(function(plr, Value1, Value2)
local char = workspace:FindFirstChild(plr.Name)
local folder = workspace:FindFirstChild(plr.Name…“'s folder”)if Value1 == “Sonar” then
print(“Working”)
if not folder:FindFirstChild(“Sonar”) then
local loads = Value2.Handle.Loads
local Charges = Value2:WaitForChild(“Charges”)if Charges.Value > 0 then local infoA = TweenInfo.new(5, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut, 0, false, 0) local propA = {Color = Color3.fromRGB(0, 0, 0)} local TweenA =game:GetService(“TweenService”):Create(loads:FindFirstChild(Charges.Value), infoA, propA)
TweenA:Play()
Charges.Value = Charges.Value - 1
elseif Charges.Value <= 0 then
return
end
local Area = Value2.Handle.Model.Area
local clone = Area:Clone()
for i, v in pairs(clone:GetChildren())do
v:Destroy()
end
clone.Anchored = true
clone.Name = “Sonar”
clone.Parent = folder
clone.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0.5, -0.5, -1)local info = TweenInfo.new(5, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut, 0, false, 0) local prop = {Size = Vector3.new(1000, 50, 1000)} local Tween = game:GetService("TweenService"):Create(clone, info, prop) Tween:Play() local be = Instance.new("BindableEvent") be.Event:Connect(function() wait(15) local info = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0) local prop = {Transparency = 1} local Tween = game:GetService("TweenService"):Create(clone, info, prop) Tween:Play() wait(1) clone:Destroy() end) be:Fire() wait(5) local min = clone.Position - (0.5 * clone.Size) local max = clone.Position + Vector3.new(1000, 50, 1000) local region = Region3.new(min, max) local Answer = 0 for _, v in pairs(workspace:FindPartsInRegion3(region, nil, math.huge)) do if v.Name == "inside" then Answer = Answer + 1 else -- end end print(Answer) if Answer == 1 then local info1 = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0) local prop1 = {Color = Color3.fromRGB(0, 255, 8)} local Tween1 = game:GetService("TweenService"):Create(clone, info1, prop1) Tween1:Play() elseif Answer == 0 then local info1 = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0) local prop1 = {Color = Color3.fromRGB(255, 0, 4)} local Tween1 = game:GetService("TweenService"):Create(clone, info1, prop1) Tween1:Play() end endend
end)