Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a mobile ragdoll button work?

I have made a ragdoll game which when you press "r" you ragdoll and to get up again. I have gotten the the button to appear from a Youtube video but can not get it to ragdoll / keybind to "r".

I also have this other script;

local contextActionService = game:GetService("ContextActionService")
function onButtonPress()
    --Ragdoll function here / Need help here
end
local mobilebutton = contextActionService:BindAction("RagdollButton",onButtonPress,true,"r")
contextActionService:SetPosition("RagdollButton",UDim2.new(0.72,-25,0.20,-25))
contextActionService:SetTitle("RagdollButton","Doll")

1 comment

0

Any suggestions is appreciated.

1 answer

Instead of that try making a separate ScreenGui and make a button for it and make the button visible = false then do the following at the top of the script (Local Script) also make the script alone.

local OnMobile = game:GetService("UserInputService").TouchEnabled
if OnMobile == true then
--function here
else
return -- returns and does no change
end

4 comments

0

I hope I helped!

0

How would I get the function in here.

0

The function uses other scripts to start, how would I get it in there? It just doesn't work..

0

I'm a little bit confused about it but do I need to make a local script and copy and paste those scripts?

This discussion is preserved as it was. New answers, comments, and votes are closed.