Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to use TweenService for LocalPlayer when Part is touched?

Asked by 5 years ago

This is in a local script and it tweens for other players when I touch the part

local Head = workspace["Zednov's Tycoon Kit"].Tycoons["Fighting Bears2"].Buttons["Buy Chocolate Mine - [$0]"].Head
local player = game.Players.LocalPlayer
local FinishedUI = script.Parent.FinshedUI.Frame
local NotificationSound = game.StarterGui.NotificationSound

   deb = true
local function touchedF(hit)
   if game.Players:FindFirstChild(hit.Parent.Name) and deb == true and player.leaderstats.Cash.Value >= 0 then
   deb = false
   FinishedUI:TweenPosition(UDim2.new(0.38, 0,0.483, 0), "In", "Back", 2)
   wait(0.5)
   NotificationSound:Play()
   NotificationSound.Looped = false
   print("UIActivated")
   wait(0.5)
   deb = true
        end
    end
Head.Touched:Connect(touchedF)

Answer this question