local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local UserInputService = game:GetService("UserInputService")
local ia = game.Players[player.Name].PlayerGui:WaitForChild("Interaction").TextLabel
UserInputService.InputBegan:connect(function(input)
for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == "Doritos" then
if (player.Character.Torso.Position - v.Position).Magnitude <= 10 then
if mouse.Target == v then
ia.Visible = true
ia.Text = "eat da derit0s [F]"
if input.KeyCode == Enum.KeyCode.F then
game.Players[player.Name]:WaitForChild("Hunger").Value = game.Players[player.Name]:WaitForChild("Hunger").Value - 5
v.Sound:Play()
v:Remove()
end
else
ia.Visible = false
end
end
end
end
for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == "Dew" then
if (player.Character.Torso.Position - v.Position).Magnitude <= 10 then
if mouse.Target == v then
ia.Visible = true
ia.Text = "drink da d3w [F]"
if input.KeyCode == Enum.KeyCode.F then
game.Players[player.Name]:WaitForChild("Thirst").Value = game.Players[player.Name]:WaitForChild("Thirst").Value - 5
v.Sound:Play()
v:Remove()
end
else
ia.Visible = false
end
end
end
end
for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == "Door" then
if (player.Character.Torso.Position - v.Position).Magnitude <= 10 then
if mouse.Target == v then
if v.Open == false then
ia.Visible = true
ia.Text = "open teh d0or [F]"
if input.KeyCode == Enum.KeyCode.F then
v.Open = true
v.Sound:Play()
v.Rotation = Vector3.new(0,90,0)
v.Position = v.Position + Vector3.new(3.7, 0, -3.7)
end
end
else
ia.Visible = false
end
end
end
end
end)
Those 3 chunks of scripts are for eating doritos, mountain dew, and opening a door(in order), and the door opening part doesn't even work in general, it doesn't rotate, or change position; and also, when your mouse hovers over an item, sometimes it doesn,t show, takes a few seconds to show, shows even after the item is gone. Can anyone help? Thanks.
