How to make an arm wrestle system?

So I think many of you know that there is such a notorious mode as an arm wrestle simulator. There you need to fight with bots and earn on-it cups. Here’s the link:Arm Wrestle Simulator - Roblox

And here I have a question for you if, for example, I want to make a system like this, that says there is a strip, and when I click it goes in my direction, and when the enemy then in his. In general, if someone does not know look at how it is realized there, so here, how to make such a system?

2 Likes

If you want to make it like this game follow these steps

First
Your game will need a good animation
After animating the dummies in wresling animation you will save the ID till now
then You will make the table that they wrestle in and put the seats name them seat 2 and seat 1 or anything you want

Second

Put a proxityprompt and an intvalue child of it
Then put this script

local Wrestle = game.ReplicatedStorage.Wrestle -- The RemoteEvent
local Pr = Script.ProxityPrompt

Pr.Triggred:Connect(Function(Plr)
local seat1 = false
local seat2 = false
local Position1 = Script.Parent.Seat1
local Position2 = Script.Parent.Seat2
Position1.CanTouch  = true
Position2.CanTouch  = true
Position2.Touched:Connect(Function(Hit)
if hit.Parent:FindFirstChild("Humanoid")
then local Player2 = Hit.Parent

Position1.Touched:Connect(Function(Hit2)
if hit.Parent:FindFirstChild("Humanoid")
then local Player1 = Hit2.Parent

local Anim = Script.Animation
if Seat1 = true then
Plr.Character.HumanoidRootPart.CFrame = Position1.CFrame
Seat1 = false
end
If Seat2 = true then
Plr.Character.HumanoidRootPart.CFrame = Seat2.CFrame
Seat2 = False
end
local Hum = Plr.Character.Humanoid
Hum:LoadAnimation(Anim):Play -- Make sure that the anim is looped
script.Parent:FireClient(Plr)
if Player1.power.Power > Player2.Power.power then
Print("Player1 won")
-- Add what happens
else
Print("Player2 won")
--Add what happens
end
end)

–You would need a power system

local currencyName = “Power”
local DataStore = game:GetService(“DataStoreService”):GetDataStore(“CurrencyDataStore”)

game.Players.PlayerAdded:Connect(function(player)

local folder = Instance.new("Folder")
folder.Name = "leaderstats"
folder.Parent = player

local currency = Instance.new("IntValue")
currency.Name = currencyName
currency.Parent = folder

local ID = currencyName.."-"..player.UserId
local savedData = nil

pcall(function()
    savedData = DataStore:GetAsync(ID)
end)

if savedData ~= nil then
	currency.Value = savedData
	print("Data loaded")
else
	-- New player
	currency.Value = 0
	print("New player to the game")
end

end)

end)
end)

game.Players.PlayerRemoving:Connect(function(player)
local ID = currencyName…“-”…player.UserId
DataStore:SetAsync(ID,player.leaderstats[currencyName].Value)
end)

game:BindToClose(function()

-- When game is ready to shutdown

for i, player in pairs (game.Players:GetPlayers()) do
    if player then
        player:Kick("This game is shutting down") 
    end
end 	     

wait(5)

end)

And would need a saver for it

local DataStoreService = game:GetService(“DataStoreService”)

local myDataStore = DataStoreService:GetDataStore(“myDataStore”)

game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new(“Folder”)
leaderstats.Name = “leaderstats”
leaderstats.Parent = player

local Coins = Instance.new("IntValue")
Coins.Name = "Power" -- currency name
Coins.Parent = leaderstats

local data
local success, errormessage = pcall(function()
	data = myDataStore:GetAsync(player.UserId.."Power")
end)

if success then
	Coins.Value = data
else
	print("there was an error while getting your data ")
	warn(errormessage)
end

end)

game.Players.PlayerRemoving:Connect(function(player)

local succes, errormessage = pcall(function()
	myDataStore:SetAsync(player.UserId.."Coins",player.leaderstats.Coins.Value)

end)

if succes then
	print("Data successfully saved!")
else
	print("There was an error when saving data")
	warn(errormessage)
end

end)

--And you will add dumbles that rise the power up
You will add to the first script a comparison between the player 1 power and player 2 power
3 Likes

wow thank you so much for your help)

2 Likes

Oh one more point make sure that both position 1 and 2 CanTouch = false --(Not in the script)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.