I made a mouse over text and if you dont know what that is its basically a text following the mouse when you hover into an chosen object, but back to the question I made a user input service function that works when the textlabel that follows the mouse is visible and if the text of the textlabel is the same with the mouse target stringvalue.value
, but its not working, please help me thank you
the script:
local player = game.Players.LocalPlayer local playergui = player:WaitForChild("PlayerGui") local UIS = game:GetService("UserInputService") local tweenservice = game:GetService("TweenService") local tweeninfoo = TweenInfo.new(2,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,true,1) local goal = {TextTransparency = 1} local tween = tweenservice:Create(playergui.ItemPickup.TextLabel, tweeninfoo, goal) UIS.InputBegan:Connect(function(input, gameProcessed) if input.UserInputType == Enum.KeyCode.E and playergui.MouseOverText.Textlabel.Visible == true and playergui.MouseOverText.Textlabel.Text == "Flashlight" then playergui.ItemPickup.TextLabel.Text = script.Parent.MouseoverText.Value tween:Play() script.Parent:Destroy() end end)
dont mind the tween service i made that so when the item got picked up it tweens in a text saying the objects name