HpacAm
(Bobo)
May 11, 2024, 4:24pm
#1
What do you want to achieve? I wanna make when player is on mobile and touches the button in StarterGui.GameGui.EmotesFrame.EmoteButton it activates the emotes gui
What is the issue? I tried to do something like that but it didn’t work.
What solutions have you tried so far? None
Here’s how to activates on PC.
uis.InputBegan:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.G then
if mFrame.Visible == false then
mFrame.Visible = true
button1.Modal = true
humanoid2:UnequipTools()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
else
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
button1.Modal = false
mFrame.Visible = false
end
end
end
end)
also this is what uis is
local uis = game:GetService("UserInputService")
1 Like
Under the entire function, put a new function like this:
EmoteButton.InputBegan:Connect(function(Input)
if Input.UserInputType == Enum.UserInputType.Touch or Input.UserInputType == Enum.UserInputType.MouseButton1 then
-- Make the emotes frame appear here
end
end)
HpacAm
(Bobo)
May 11, 2024, 4:44pm
#3
Sorry but it didn’t work for me, I also tried to modify it a little but it still didn’t work
Are there any errors in the console? Since it did work for me. You may have put the wrong button or something?
HpacAm
(Bobo)
May 11, 2024, 4:47pm
#5
There are no errors in the console
Can you send me your entire code?
HpacAm
(Bobo)
May 11, 2024, 4:55pm
#7
it’s way too long but okay.
local uis = game:GetService("UserInputService")
local mFrame = script.Parent.Parent.Emote
local gui = game.StarterGui:WaitForChild("GameGui")
local EmoteButton = gui.EmotesFrame.EmoteButton
local player = game.Players.LocalPlayer
local character2 = player.Character
local humanoid2 = character2:WaitForChild("Humanoid")
local button1 = script.Parent.List["1"].TextButton
local button2 = script.Parent.List["2"].TextButton
local button3 = script.Parent.List["3"].TextButton
local button4 = script.Parent.List["4"].TextButton
local button5 = script.Parent.List["5"].TextButton
local button6 = script.Parent.List["6"].TextButton
local button7 = script.Parent.List["7"].TextButton
local button8 = script.Parent.List["8"].TextButton
local button9 = script.Parent.List["9"].TextButton
uis.InputBegan:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.G then
if mFrame.Visible == false then
mFrame.Visible = true
button1.Modal = true
humanoid2:UnequipTools()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
else
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
button1.Modal = false
mFrame.Visible = false
end
end
end
end)
EmoteButton.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then
if mFrame.Visible == false then
mFrame.Visible = true
button1.Modal = true
humanoid2:UnequipTools()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
else
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
button1.Modal = false
mFrame.Visible = false
end
end
end)
local hover = script:WaitForChild("Hover")
local clicked = script:WaitForChild("Click")
--previewsounds
local boppinpreview = script:WaitForChild("boppinprev")
local breakdanceepreview = script:WaitForChild("breakdanceprev")
local shimmerpreview = script:WaitForChild("shimmerprev")
local catchasepreview = script:WaitForChild("catchaseprev")
local hypepreview = script:WaitForChild("hypeprev")
local begginpreview = script:WaitForChild("begginprev")
local oranngejusticepreview = script:WaitForChild("orangejuistceprev")
local griddypreview = script:WaitForChild("griddyprev")
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
----sounds/music----
local yume = game.ReplicatedStorage.Assets.Songs.boppin
local yumeClone = yume:Clone()
yumeClone.Parent = character.HumanoidRootPart
--breakdance--
local brean = game.ReplicatedStorage.Assets.Songs.breakd
local breanClone = brean:Clone()
breanClone.Parent = character.HumanoidRootPart
--shimmer
local shim = game.ReplicatedStorage.Assets.Songs.shimmer
local shimClone = shim:Clone()
shimClone.Parent = character.HumanoidRootPart
--holdl
local holdit = game.ReplicatedStorage.Assets.Songs.getnoobed
local holditClone = holdit:Clone()
holditClone.Parent = character.HumanoidRootPart
--catchase
local catcahse = game.ReplicatedStorage.Assets.Songs.catchase
local catcahseClone = catcahse:Clone()
catcahseClone.Parent = character.HumanoidRootPart
--hype
local hyper = game.ReplicatedStorage.Assets.Songs.hype
local hyperClone = hyper:Clone()
hyperClone.Parent = character.HumanoidRootPart
--beggin
local beggar = game.ReplicatedStorage.Assets.Songs.beggin
local beggarClone = beggar:Clone()
beggarClone.Parent = character.HumanoidRootPart
---------------
local roypurdy = game.ReplicatedStorage.Assets.Songs.oj
local roypurdyClone = roypurdy:Clone()
roypurdyClone.Parent = character.HumanoidRootPart
--orangejustice-
local yungboi = game.ReplicatedStorage.Assets.Songs.creeper
local yungboiClone = yungboi:Clone()
yungboiClone.Parent = character.HumanoidRootPart
--griddy
---------------
----animations----
local boppin = script.Configuration["1"]
local breakdance = script.Configuration["2"]
local shimmer = script.Configuration["3"]
local l = script.Configuration["4"]
local catcahsee = script.Configuration["5"]
local hypa = script.Configuration["6"]
local beg = script.Configuration["7"]
local royp = script.Configuration["8"]
local yungst = script.Configuration["9"]
------------------
----animationtracks----
local dancingtest = humanoid:LoadAnimation(boppin)
local dancingtes2t = humanoid:LoadAnimation(breakdance)
local dancingtest3 = humanoid:LoadAnimation(shimmer)
local dancingtest4 = humanoid:LoadAnimation(l)
local dancingtest5 = humanoid:LoadAnimation(catcahsee)
local dancingtest6 = humanoid:LoadAnimation(hypa)
local dancingtest7 = humanoid:LoadAnimation(beg)
local dancingtest8 = humanoid:LoadAnimation(royp)
local dancingtest9 = humanoid:LoadAnimation(yungst)
-----------------------
local eventt = game.ReplicatedStorage.Assets.Events.CharacterAnimation
button1.MouseEnter:Connect(function()
boppinpreview:Play()
hover:Play()
wait(1.5)
boppinpreview.Volume = 0.40
wait(0.1)
boppinpreview.Volume = 0.30
wait(0.1)
boppinpreview.Volume = 0.20
wait(0.1)
boppinpreview.Volume = 0.10
wait(0.1)
boppinpreview.Volume = 0
boppinpreview.Volume = 0.5
boppinpreview:Stop()
shimmerpreview:Stop()
breakdanceepreview:Stop()
hypepreview:Stop()
catchasepreview:Stop()
begginpreview:Stop()
oranngejusticepreview:Stop()
end)
button2.MouseEnter:Connect(function()
breakdanceepreview:Play()
hover:Play()
wait(1.5)
breakdanceepreview.Volume = 0.40
wait(0.1)
breakdanceepreview.Volume = 0.30
wait(0.1)
breakdanceepreview.Volume = 0.20
wait(0.1)
breakdanceepreview.Volume = 0.10
wait(0.1)
breakdanceepreview.Volume = 0
breakdanceepreview.Volume = 0.5
breakdanceepreview:Stop()
boppinpreview:Stop()
shimmerpreview:Stop()
hypepreview:Stop()
catchasepreview:Stop()
begginpreview:Stop()
oranngejusticepreview:Stop()
end)
button3.MouseEnter:Connect(function()
shimmerpreview:Play()
hover:Play()
wait(1.5)
shimmerpreview.Volume = 0.40
wait(0.1)
shimmerpreview.Volume = 0.30
wait(0.1)
shimmerpreview.Volume = 0.20
wait(0.1)
shimmerpreview.Volume = 0.10
wait(0.1)
shimmerpreview.Volume = 0
shimmerpreview.Volume = 0.5
shimmerpreview:Stop()
boppinpreview:Stop()
breakdanceepreview:Stop()
hypepreview:Stop()
catchasepreview:Stop()
begginpreview:Stop()
oranngejusticepreview:Stop()
end)
button4.MouseEnter:Connect(function()
hover:Play()
end)
button5.MouseEnter:Connect(function()
catchasepreview:Play()
hover:Play()
wait(1.5)
catchasepreview.Volume = 0.40
wait(0.1)
catchasepreview.Volume = 0.30
wait(0.1)
catchasepreview.Volume = 0.20
wait(0.1)
catchasepreview.Volume = 0.10
wait(0.1)
catchasepreview.Volume = 0
catchasepreview.Volume = 0.5
catchasepreview:Stop()
boppinpreview:Stop()
shimmerpreview:Stop()
breakdanceepreview:Stop()
hypepreview:Stop()
begginpreview:Stop()
oranngejusticepreview:Stop()
end)
button6.MouseEnter:Connect(function()
hypepreview:Play()
hover:Play()
wait(1.5)
hypepreview.Volume = 0.40
wait(0.1)
hypepreview.Volume = 0.30
wait(0.1)
hypepreview.Volume = 0.20
wait(0.1)
hypepreview.Volume = 0.10
wait(0.1)
hypepreview.Volume = 0
hypepreview.Volume = 0.5
hypepreview:Stop()
boppinpreview:Stop()
shimmerpreview:Stop()
breakdanceepreview:Stop()
catchasepreview:Stop()
begginpreview:Stop()
oranngejusticepreview:Stop()
end)
button7.MouseEnter:Connect(function()
begginpreview:Play()
hover:Play()
wait(1.5)
begginpreview.Volume = 0.40
wait(0.1)
begginpreview.Volume = 0.30
wait(0.1)
begginpreview.Volume = 0.20
wait(0.1)
begginpreview.Volume = 0.10
wait(0.1)
begginpreview.Volume = 0
begginpreview.Volume = 0.5
begginpreview:Stop()
boppinpreview:Stop()
shimmerpreview:Stop()
breakdanceepreview:Stop()
hypepreview:Stop()
catchasepreview:Stop()
oranngejusticepreview:Stop()
end)
button8.MouseEnter:Connect(function()
oranngejusticepreview:Play()
hover:Play()
wait(1.5)
oranngejusticepreview.Volume = 0.40
wait(0.1)
oranngejusticepreview.Volume = 0.30
wait(0.1)
oranngejusticepreview.Volume = 0.20
wait(0.1)
oranngejusticepreview.Volume = 0.10
wait(0.1)
oranngejusticepreview.Volume = 0
oranngejusticepreview.Volume = 0.5
oranngejusticepreview:Stop()
boppinpreview:Stop()
shimmerpreview:Stop()
breakdanceepreview:Stop()
hypepreview:Stop()
catchasepreview:Stop()
begginpreview:Stop()
end)
button9.MouseEnter:Connect(function()
griddypreview:Play()
hover:Play()
wait(1.5)
griddypreview.Volume = 0.40
wait(0.1)
griddypreview.Volume = 0.30
wait(0.1)
griddypreview.Volume = 0.20
wait(0.1)
griddypreview.Volume = 0.10
wait(0.1)
griddypreview.Volume = 0
griddypreview.Volume = 0.5
griddypreview:Stop()
boppinpreview:Stop()
shimmerpreview:Stop()
breakdanceepreview:Stop()
hypepreview:Stop()
catchasepreview:Stop()
begginpreview:Stop()
oranngejusticepreview:Stop()
end)
button1.MouseButton1Click:Connect(function()
button1.Modal = false
oranngejusticepreview:Stop()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
boppinpreview:Stop()
shimmerpreview:Stop()
breakdanceepreview:Stop()
hypepreview:Stop()
catchasepreview:Stop()
begginpreview:Stop()
humanoid:UnequipTools()
dancingtes2t:Stop()
dancingtest3:Stop()
dancingtest4:Stop()
dancingtest5:Stop()
dancingtest6:Stop()
dancingtest7:Stop()
dancingtest8:Stop()
dancingtest9:Stop()
catcahseClone:Stop()
roypurdyClone:Stop()
shimClone:Stop()
breanClone:Stop()
hyperClone:Stop()
beggarClone:Stop()
holditClone:Stop()
breanClone:Stop()
yungboiClone:Stop()
dancingtest:Play()
yumeClone:Play()
eventt:FireServer()
player.CameraMode = Enum.CameraMode.Classic
character.Humanoid.Changed:Connect(function()
if humanoid.MoveDirection.Magnitude ~= 0 then
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
dancingtest:Stop()
player.CameraMode = Enum.CameraMode.Classic
yumeClone:Stop()
end
end)
mFrame.Visible = false
print("Clicked")
clicked:Play()
end)
button2.MouseButton1Click:Connect(function()
button1.Modal = false
oranngejusticepreview:Stop()
breakdanceepreview:Stop()
boppinpreview:Stop()
shimmerpreview:Stop()
hypepreview:Stop()
catchasepreview:Stop()
begginpreview:Stop()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
humanoid:UnequipTools()
dancingtest:Stop()
dancingtest3:Stop()
dancingtest4:Stop()
dancingtest5:Stop()
dancingtest6:Stop()
dancingtest7:Stop()
dancingtest8:Stop()
catcahseClone:Stop()
dancingtest9:Stop()
roypurdyClone:Stop()
shimClone:Stop()
yumeClone:Stop()
hyperClone:Stop()
beggarClone:Stop()
holditClone:Stop()
yungboiClone:Stop()
dancingtes2t:Play()
breanClone:Play()
eventt:FireServer()
player.CameraMode = Enum.CameraMode.Classic
character.Humanoid.Changed:Connect(function()
if humanoid.MoveDirection.Magnitude ~= 0 then
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
dancingtes2t:Stop()
player.CameraMode = Enum.CameraMode.Classic
breanClone:Stop()
end
end)
mFrame.Visible = false
print("Clicked")
clicked:Play()
end)
button3.MouseButton1Click:Connect(function()
dancingtest9:Stop()
button1.Modal = false
oranngejusticepreview:Stop()
boppinpreview:Stop()
shimmerpreview:Stop()
breakdanceepreview:Stop()
hypepreview:Stop()
catchasepreview:Stop()
begginpreview:Stop()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
humanoid:UnequipTools()
dancingtest:Stop()
dancingtes2t:Stop()
dancingtest4:Stop()
dancingtest5:Stop()
dancingtest6:Stop()
dancingtest7:Stop()
dancingtest8:Stop()
catcahseClone:Stop()
roypurdyClone:Stop()
yumeClone:Stop()
yungboiClone:Stop()
hyperClone:Stop()
beggarClone:Stop()
holditClone:Stop()
breanClone:Stop()
shimmerpreview:Stop()
dancingtest3:Play()
shimClone:Play()
eventt:FireServer()
player.CameraMode = Enum.CameraMode.Classic
character.Humanoid.Changed:Connect(function()
if humanoid.MoveDirection.Magnitude ~= 0 then
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
dancingtest3:Stop()
player.CameraMode = Enum.CameraMode.Classic
shimClone:Stop()
end
end)
mFrame.Visible = false
print("Clicked")
clicked:Play()
end)
button4.MouseButton1Click:Connect(function()
dancingtest9:Stop()
button1.Modal = false
oranngejusticepreview:Stop()
boppinpreview:Stop()
shimmerpreview:Stop()
breakdanceepreview:Stop()
hypepreview:Stop()
catchasepreview:Stop()
begginpreview:Stop()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
humanoid:UnequipTools()
dancingtest:Stop()
dancingtes2t:Stop()
yungboiClone:Stop()
dancingtest3:Stop()
dancingtest5:Stop()
dancingtest6:Stop()
dancingtest7:Stop()
dancingtest8:Stop()
catcahseClone:Stop()
roypurdyClone:Stop()
shimClone:Stop()
yumeClone:Stop()
hyperClone:Stop()
beggarClone:Stop()
breanClone:Stop()
dancingtest4:Play()
holditClone:Play()
eventt:FireServer()
player.CameraMode = Enum.CameraMode.Classic
character.Humanoid.Changed:Connect(function()
if humanoid.MoveDirection.Magnitude ~= 0 then
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
dancingtest4:Stop()
player.CameraMode = Enum.CameraMode.Classic
holditClone:Stop()
end
end)
mFrame.Visible = false
print("Clicked")
clicked:Play()
end)
button5.MouseButton1Click:Connect(function()
dancingtest9:Stop()
button1.Modal = false
oranngejusticepreview:Stop()
boppinpreview:Stop()
shimmerpreview:Stop()
breakdanceepreview:Stop()
hypepreview:Stop()
catchasepreview:Stop()
begginpreview:Stop()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
humanoid:UnequipTools()
dancingtest:Stop()
dancingtes2t:Stop()
yungboiClone:Stop()
dancingtest3:Stop()
dancingtest4:Stop()
dancingtest5:Stop()
dancingtest6:Stop()
dancingtest7:Stop()
dancingtest8:Stop()
roypurdyClone:Stop()
shimClone:Stop()
yumeClone:Stop()
hyperClone:Stop()
beggarClone:Stop()
holditClone:Stop()
breanClone:Stop()
dancingtest5:Play()
catcahseClone:Play()
eventt:FireServer()
player.CameraMode = Enum.CameraMode.Classic
character.Humanoid.Changed:Connect(function()
if humanoid.MoveDirection.Magnitude ~= 0 then
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
dancingtest5:Stop()
player.CameraMode = Enum.CameraMode.Classic
catcahseClone :Stop()
end
end)
mFrame.Visible = false
print("Clicked")
clicked:Play()
end)
button6.MouseButton1Click:Connect(function()
dancingtest9:Stop()
button1.Modal = false
oranngejusticepreview:Stop()
boppinpreview:Stop()
shimmerpreview:Stop()
breakdanceepreview:Stop()
hypepreview:Stop()
catchasepreview:Stop()
begginpreview:Stop() game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
humanoid:UnequipTools()
dancingtest:Stop()
dancingtes2t:Stop()
yungboiClone:Stop()
dancingtest3:Stop()
dancingtest4:Stop()
dancingtest5:Stop()
dancingtest7:Stop()
dancingtest8:Stop()
catcahseClone:Stop()
roypurdyClone:Stop()
shimClone:Stop()
yumeClone:Stop()
beggarClone:Stop()
holditClone:Stop()
breanClone:Stop()
dancingtest6:Play()
hyperClone:Play()
eventt:FireServer()
player.CameraMode = Enum.CameraMode.Classic
character.Humanoid.Changed:Connect(function()
if humanoid.MoveDirection.Magnitude ~= 0 then
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
dancingtest6:Stop()
player.CameraMode = Enum.CameraMode.Classic
hyperClone:Stop()
end
end)
mFrame.Visible = false
print("Clicked")
clicked:Play()
end)
button7.MouseButton1Click:Connect(function()
dancingtest9:Stop()
button1.Modal = false
oranngejusticepreview:Stop()
boppinpreview:Stop()
shimmerpreview:Stop()
breakdanceepreview:Stop()
hypepreview:Stop()
catchasepreview:Stop()
begginpreview:Stop() game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
humanoid:UnequipTools()
dancingtest:Stop()
dancingtes2t:Stop()
yungboiClone:Stop()
dancingtest3:Stop()
dancingtest4:Stop()
dancingtest5:Stop()
dancingtest6:Stop()
dancingtest8:Stop()
catcahseClone:Stop()
roypurdyClone:Stop()
shimClone:Stop()
yumeClone:Stop()
hyperClone:Stop()
holditClone:Stop()
breanClone:Stop()
dancingtest7:Play()
beggarClone:Play()
eventt:FireServer()
player.CameraMode = Enum.CameraMode.Classic
character.Humanoid.Changed:Connect(function()
if humanoid.MoveDirection.Magnitude ~= 0 then
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
dancingtest7:Stop()
player.CameraMode = Enum.CameraMode.Classic
beggarClone:Stop()
end
end)
mFrame.Visible = false
print("Clicked")
clicked:Play()
end)
button8.MouseButton1Click:Connect(function()
dancingtest9:Stop()
button1.Modal = false
oranngejusticepreview:Stop()
boppinpreview:Stop()
shimmerpreview:Stop()
breakdanceepreview:Stop()
hypepreview:Stop()
catchasepreview:Stop()
begginpreview:Stop() game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
humanoid:UnequipTools()
dancingtest:Stop()
dancingtes2t:Stop()
yungboiClone:Stop()
dancingtest3:Stop()
dancingtest4:Stop()
dancingtest5:Stop()
dancingtest6:Stop()
dancingtest7:Stop()
catcahseClone:Stop()
shimClone:Stop()
yumeClone:Stop()
hyperClone:Stop()
beggarClone:Stop()
holditClone:Stop()
breanClone:Stop()
dancingtest8:Play()
roypurdyClone:Play()
eventt:FireServer()
player.CameraMode = Enum.CameraMode.Classic
character.Humanoid.Changed:Connect(function()
if humanoid.MoveDirection.Magnitude ~= 0 then
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
dancingtest8:Stop()
player.CameraMode = Enum.CameraMode.Classic
roypurdyClone:Stop()
end
end)
mFrame.Visible = false
print("Clicked")
clicked:Play()
end)
button9.MouseButton1Click:Connect(function()
button1.Modal = false
oranngejusticepreview:Stop()
boppinpreview:Stop()
shimmerpreview:Stop()
breakdanceepreview:Stop()
hypepreview:Stop()
catchasepreview:Stop()
begginpreview:Stop() game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
humanoid:UnequipTools()
dancingtest:Stop()
dancingtes2t:Stop()
dancingtest3:Stop()
dancingtest4:Stop()
dancingtest5:Stop()
dancingtest6:Stop()
dancingtest7:Stop()
dancingtest8:Stop()
catcahseClone:Stop()
shimClone:Stop()
yumeClone:Stop()
hyperClone:Stop()
beggarClone:Stop()
holditClone:Stop()
breanClone:Stop()
roypurdyClone:Stop()
dancingtest9:Play()
yungboiClone:Play()
eventt:FireServer()
player.CameraMode = Enum.CameraMode.Classic
character.Humanoid.Changed:Connect(function()
if humanoid.MoveDirection.Magnitude ~= 0 then
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
dancingtest9:Stop()
player.CameraMode = Enum.CameraMode.Classic
yungboiClone:Stop()
end
end)
mFrame.Visible = false
print("Clicked")
clicked:Play()
end)
Ok let us focus on the part we are working on. Change them with this: (I added a few print statements)
uis.InputBegan:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.G then
if mFrame.Visible == false then
mFrame.Visible = true
button1.Modal = true
humanoid2:UnequipTools()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
else
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
button1.Modal = false
mFrame.Visible = false
end
end
end
end)
EmoteButton.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then
print("test1")
if mFrame.Visible == false then
print("test2")
mFrame.Visible = true
button1.Modal = true
humanoid2:UnequipTools()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
else
print("test")
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
button1.Modal = false
mFrame.Visible = false
end
end
end)
When done with this, run the code and tell me what it prints.
HpacAm
(Bobo)
May 11, 2024, 5:05pm
#9
It prints nothing, i tried on different devices too (mobile and pc)
Then it’s probably not been loaded correctly, try adding a waitforchild at the top, see what happens.
HpacAm
(Bobo)
May 11, 2024, 5:13pm
#11
Nothing happens, i’m confused why it doesn’t work and why it doesn’t print
Under local EmoteButton = gui.EmotesFrame.EmoteButton
fire print(EmoteButton)
and see what it says.
HpacAm
(Bobo)
May 11, 2024, 5:25pm
#13
it prints EmoteButton
but the others doesn’t print (test, test1, test2)
Ah yes, so the mistake you are making is referring to it as StarterGui.MainGUI.EmoteButton, you should be referring to it as PlayerGui.MainGUI.EmoteButton, as this is the UI for the individual player.
Put it in a :WaitForChild() as it is most likely still loading.
2 Likes
To make a GUI appear when a player is on mobile you should use Button.TouchTap
, also keep in mind if you have a Button.MouseButton1Click
it will activiate it twice. TouchTap
works for both mobile and PC.
2 Likes
system
(system)
Closed
May 25, 2024, 5:46pm
#18
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.