#Exercise Coding

31 messages · Page 1 of 1 (latest)

errant cliff
#

Hey Guys, I've just joined this server. I was inspired to create my own Gym Game where I can create different things.. I've spent enough time in scripting and know the basics. But from several hours now I cannot do that thing. What I want to create is use Proximity Prompt on model with which you get in a position and play the animation upon clicking. I've searched for such youtube tutorials and did not found any.. If you can help me understand how it works and how to do I would appirciate it. It's crucial as it's my first game! You can see the Animation and the Pull up Bar. I want to create simply Hold E from proximity prompt get onto the bar. Press MouseButton and play animation! Also I want to ask do I need to create instances of my barbells and bars in order to do that

#

Please ping me as I'm creating equipment for my game. 😄

errant cliff
#

No code.. I cannot.. do it I have deleted them from anger.

#

It showed no erros but it did not work.

sterile nexus
# errant cliff Hey Guys, I've just joined this server. I was inspired to create my own Gym Game...

yeah thats definitely possible
You gotta have 2 animations: One where the player is idle on the bar and one where they do one pushUp

Then you need a script where you detect the proximity prompt being triggered and :PivotTo the player to the correct position, remember to anchor the rootpart, then load the animation on the humanoid's animator, whenever the player clicks send a remote event to do a push up

#

thats the basics

hardy niche
#

some ppl are chill and some are toxic

errant cliff
#

To show you what i wanted to do.

errant cliff
#
local ProximityPrompt = script.Parent.ProximityPrompt

local ANIMATION_ID = "17380863163"

local function OnPromptTriggered(player)
    local character = player.Character
    if not character then return end 
    local humanoid = character:FindFirstChildOfClass("Humanoid")
    if not humanoid then return end 

    Instance.new("Animation")
    animation.AnimationId = "rbxassetid://" .. ANIMATION_ID

    local animationTrack = humanoid:LoadAnimation(animation)
    animationTrack:Play()
end

ProximityPrompt.Triggered:Connect(OnPromptTriggered)
errant cliff
hardy niche
#

or :PivotTo()

errant cliff
#

What is hrp?

glossy arrowBOT
#

studio** You are now Level 1! **studio

hardy niche
#

(HumanoidRootPart)

errant cliff
#

I'll try.

hardy niche
#

so when ur animating

#

copy the hrp position

#

where it should be

errant cliff
#

which will be easier I hear about PivotTo() as of now.. umm what should I Do I copy my character's position create a cframe and..?

#

I'll watch a tutorial

#

What should I save my new animation as, @hardy niche ?

#

Like it's priority.. new priority.

#

I can't do it. Could you please provide me with an example?

hardy niche
#

im so high rn and tired af