Im having a problem, once the player clicks the pancake its suppose to go up then down but instead it goes a completely different direction, also as the player moves the pancake gets farther away from the pan when clicked. im using a weldConstraint to weld the pancake and the pan together. photo:
video:
script im using:
local tool = script.Parent
local handle = tool:WaitForChild(“Handle”)
local Pancake = tool:WaitForChild(“Pancake”) – the pancake model
local middle = tool:WaitForChild(“Middle”) – where the pancake sits on
local TS = game:GetService(“TweenService”)
local db = false – debounce
local Multi = tool:WaitForChild(“Multi”) – flips multi
local sss = game:GetService(“ServerScriptService”)
local PopUp = require(sss:WaitForChild(“PancakePopUp”)) – get module
local seconds = tool:WaitForChild(“Seconds”) – basically debounce
local swoosh = middle:WaitForChild(“Swoosh”) – audio
local info = TweenInfo.new( – tween info
0.8,
Enum.EasingStyle.Quad,
Enum.EasingDirection.InOut,
0,
true,
0
)
local StartTween = Pancake.Position + Vector3.new(0,1,0) – bring pancake up
local CloseTween = Pancake.Position + Vector3.new(0,-1,0) – bring pancake down
local TWStart = TS:Create(Pancake,info,{Position = StartTween}) – tween pancake
local TWClose = TS:Create(Pancake,info,{Position = CloseTween}) – tween pancake
tool.Activated:Connect(function()
if not db then
db = true
local plr = game.Players:GetPlayerFromCharacter(tool.Parent)
PopUp.PopUp(plr,Multi,seconds) -- pancakePopUp
swoosh:Play() -- audio
plr.leaderstats.Flips.Value = plr.leaderstats.Flips.Value+Multi.Value -- add value
TWStart:Play()-- play tweens
wait(0.5)
TWClose:Play()
wait(seconds.Value)
db = false
end
end)