Help with my skating system

I’m trying to achieve a system like adopt me which is compatible on any device, which is called their Ice Skating system, the player slowly increases speed while skating but has a maximum of 20 walkspeed, correct me if I’m wrong.
Once the player touches the ice the boots appear, their HipHeight changes to higher and their tool gets unequipped, then a new idle animation starts playing as I would call it: “SkateIdle”
Once they start skating a skating anim starts, once they slow down a sort of “Scared animation” plays. And also the boots leave a sort of ice trail on the ice (forgot to mention).
Once the player gets off the ice they can equip tools again and their boots, ice skating system and their ice skating animations get removed and their walkspeed get reset to 16, and also their HipHeight gets reset too.

I’ve tried several thing such as hit.Parent or
TouchEnded but ended up failing all of my scripts.

If you would like to see what I mean, play Adopt Me and go to the place where the lake should be located. It’s all ice, jump onto it and you’ll see what I mean.

Thanks
-Daniel

3 Likes

You just need to have the shoes in the replicated storage. Then, you would have a .Touched event on the part. And once someone touches it, simply clone the boots to the player that touched it

1 Like

I know, I’ve tried that. The boots are both a seperated accesoire in repstorage.
But that still doesn’t remove it when the player stops touching. I need an example script for this too so I’ll understand better.

ahh, so all you have to do is use .TouchEnded and then delete the boot.

part.TouchEnded:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Skates") then
        hit.Parent.Skates:Destroy()
    end
end)
1 Like

I still don’t understand tho. I need it so if the player touches the ice the hipheight goes higher and the shoes will be applied and they’ll play an idle animation of the skating system and once they skate they’ll play an skating animation. Once they stop touching the ice the hipheight will get reset to default and the boots disappear back to repstorage. And the skating animations should disappear back to repstorage too.

I need it in a example script as I’m not the greatest with :Clone

Part scripts:

Touched:

 part.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") and not hit.Parent:FindFirstChild("Skates") then
        game.ReplicatedStorage.Skates:Clone().Parent = hit.Parent
    end
end)

Touch ended:

part.TouchEnded:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Skates") then
        hit.Parent.Skates:Destroy()
    end
end)

CharacterScript(local script):

local function ChildAdded(child)
    if child:IsA("Accessory") and child.Name == "Skates" then
        -- play animation if the player goes forward
    end
end

script.Parent.ChildAdded:Connect(ChildAdded)

How to load an animation and play it:

local Anim = Instance.new("Animation")
Anim.AnimationId = "http://www.roblox.com/Asset?ID="..AnimationIdHere
local LoadAnimation = player.Character.Humanoid:LoadAnimation(Anim)
LoadAnimation:Play()

How to stop an animation from playing:

LoadAnimation:Stop()

2 Likes

Where would I put the scripts? Inside the part or serverscriptservice?

Btw, I need the HipHeight to Change higher too. It needs to fit the size of the skates.(I’ll figure out what the height of those are)

The touched and touch ended are one script, put inside the part that would give the skates. And the other one is in the starter character scripts.

If you want to change the hip height, then simply do

hit.Parent.Humanoid.HipHeight = the hip height plus the skate height

2 Likes

And what about the animations? What if I put the animations both in the left skate, one called Idle the other one called Movement, if the player is standing still on the ice the idle plays, if the player moves on the ice the movement anim plays and after that if they stop touching the ice the animations will be stopped and the normal idle and walk comes back?

No, you put the animations in the character, not the skates

1 Like

But how would I do that? As I said I’m not the best with cloning.

You get the animation Id, then you load it into the character with an animation instance, and then, lastly, you play it when the player moves forward, and stop it when the player stops.

1 Like

Could you edit your old post in this topic with the scripts to add that? I don’t understand.

So what exactly do you have right now and what exactly do you need help with? Do you want to recreate this entire thing or just the player entering and getting off the ice? When I joined Adopt me to check it out, I believe they are using a Touched event on the ice. When the player touches the ice it checks if it’s a player. If its a player and this player isn’t already skating then setup the animation and make them skate. Now when the touch has ended check if they are skating, if they are, make them walk normally. If you could prove some script examples for us to help you out that was be great :slight_smile:

2 Likes

@SkoobiDoobiDoo
Well I need help with everything actually I just mentioned. I just kept failing onto where the script breaks the entire game…
My example is “Adopt Me!” an Roblox game.
Someone helped me earlier with this but that’s only the skating animation, which ended up breaking too.
Touched:

 part.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") and not hit.Parent:FindFirstChild("Skates") then
        game.ReplicatedStorage.Skates:Clone().Parent = hit.Parent
    end
end)

Touch ended:

part.TouchEnded:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Skates") then
        hit.Parent.Skates:Destroy()
    end
end)

CharacterScript(local script):

local function ChildAdded(child)
    if child:IsA("Accessory") and child.Name == "Skates" then
        -- play animation if the player goes forward
    end
end

script.Parent.ChildAdded:Connect(ChildAdded)

How to load an animation and play it:

local Anim = Instance.new("Animation")
Anim.AnimationId = "http://www.roblox.com/Asset?ID="..AnimationIdHere
local LoadAnimation = player.Character.Humanoid:LoadAnimation(Anim)
LoadAnimation:Play()

How to stop an animation from playing:

LoadAnimation:Stop()

1 Like