#Mobile Button Help
1 messages · Page 1 of 1 (latest)
hii hii!!! you can use a RemoteEvent or a BindableEvent
^^
Oh hello
I do have a question
Could you help me with that
** You are now Level 2! **
Ok ok
https://create.roblox.com/docs/reference/engine/classes/RemoteEvent
https://create.roblox.com/docs/reference/engine/classes/BindableEvent
An object which facilitates asynchronous, one-way communication across the
client-server boundary. Scripts firing a Class.RemoteEvent do not yield.
Probably just one since its a running thingymajig
or you can use none!
Im assumign your run script is a... localscript?
So just reference the button! ^^
Oh ok
It's fine
The thing is
I have like
It's custom animation scripts
So I have a walk
And a run
When I click a key
It alternated
Alternates
r u saying the one key activates two things
Between the run or walk
Yes it's the r key
and you want to distinguish
When I click r it stops the custom animation script
between what u want
For walking
I want to replicate that
But with a button
I mean like
When I click the button
It does the same thing
oh
ok so basically on pc u want “r” to do something
and on mobile a button to do the same thing
Ok I don't understand that but I'll tell you, the scripts are local scripts inside of startercharacterscripts
ok so like
you could technically copy and paste the same walk animation logic into the on event for the button
and also when the player presses R
Btw it also has a resume walk animation script which is just a script
Ok so what do you want me to do
that function will do the animation when called
** You are now Level 1! **
Can you show me step by step
Oh ok mb
ok so
real quick
i would make a function in the module script
that function would activate the animation
Where is that
wym that
Function and module script I don't understand
** You are now Level 3! **
oh
you know what module scripts do
theyre things that let you share code
Across multiple scripts
Ok so but I don't see a module script
Do you want me to like
Go inside a folder
And make a module script?
yeah
Like add a module script to something?
You're the goat bro
Ok what script
oh
Make the button
I already have the run and walk for the r key
I just need to make it for the button
But I don't know how to
Want me to show you?
@pulsar drum
Do you see
local UserInputService = game:GetService("UserInputService")
local function playAnimation()
print("animation played")
-- blah blah
end
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.R then
playAnimation()
end
end)
local button = game.StarterGui.TextButton
button.MouseButton1Click:Connect(function()
playAnimation()
end)
does this answer the question
it checks if u inputed “r” or press a pre made button and fires the same code
Do you want me to put that code inside of the run script
@pulsar drum
Yo you there
Yo kool
@pulsar drum
What if
Yo Kool it's fine I don't think you can help me
** You are now Level 4! **