Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a mobile ragdoll button work?

Asked by 4 years ago
Edited 4 years ago

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")
0
Any suggestions is appreciated. EH2019SIT 78 — 4y

1 answer

Log in to vote
0
Answered by
danklua 72
4 years ago

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
0
I hope I helped! danklua 72 — 4y
0
How would I get the function in here. EH2019SIT 78 — 4y
0
The function uses other scripts to start, how would I get it in there? It just doesn't work.. EH2019SIT 78 — 4y
0
I'm a little bit confused about it but do I need to make a local script and copy and paste those scripts? YAT4P 0 — 4y
Ad

Answer this question