end)
script.Parent.Touched:Connect(function(hit)
OffTG = false
local tween = TweenService:Create(
hit.Parent.Bottom,
TweenInfo.new(30, Enum.EasingStyle.Linear),
{ Color = Color3.fromRGB(86, 66, 54) }
)
local tween2 = TweenService:Create(
hit.Parent.Top,
TweenInfo.new(30, Enum.EasingStyle.Linear),
{ Color = Color3.fromRGB(204, 142, 105) }
)
if hit.Name == “Hitbox” then
print("on")
hit.Parent.Holding.Changed:Connect(function()
if OffTG == false then
if hit.Parent.Holding.Value == false then
if hit.Parent.UnFlipped.Value == true then
hit.ProximityPrompt.Enabled = true
tween:Play()
tween2:Play()
hit.Sizzle:Play()
end
else
hit.ProximityPrompt.Enabled = false
tween:Pause()
tween2:Pause()
hit.Sizzle:Stop()
end
end
end)
end
end)
its for a grill script, there is a script that lets you move a patty on the grill and this scripts is supposed to detect when the patty is on but sometimes it does not fire properly when it moves too fast or simply just placing there and not firing
How do you put the patty on the grill? If you assign a button to “placing down the patty” then you can just paste your code inside that instead of the touch event. If you physically have to lift and drop the patty onto the grill, I recommend using a detection area on top of the grill and checking every second if the patty is inside that area.
For that, create a part that’s just above the grill (where the patties could be) and use a loop that checks every second if a patty is inside that part.
patty moving script is really just clicking on the part and then the parts cframe updates with the mouse cframe everytime it changes. im new to this kind of stuff, what do you think i should use?