Roblox Forum banner

How to post a scripting question

1854 Views 0 Replies 1 Participant Last post by  Aaron
If you're looking for scripting help, it's much easier for people to help you if you make your question clear.

Make your title specific!

Not: "help me please"
Good example: "Error with weapon script"
This makes it easier for other people that also need help with a similar issue to find your thread.

Sharing Code
When sharing code, please use the code tag, this makes it much nicer to understand your code.

Product Rectangle Font Parallel Pattern



This will make your code look like this:

Code:
local bodyColor = Color3.new(0.152941, 0.333333, 0.00392157)

local players = game:GetService('Players')
local runService = game:GetService('RunService')

script.Parent.Touched:Connect(function(part)
    local character = part:FindFirstAncestorOfClass('Model')
    if not players:GetPlayerFromCharacter(character) then return end
    local humanoid = character:FindFirstChildOfClass('Humanoid')
    if not humanoid then return end
    local descriptionClone = humanoid:GetAppliedDescription()
    if descriptionClone.HeadColor == bodyColor then return end
    descriptionClone.HeadColor = bodyColor
    descriptionClone.TorsoColor = bodyColor
    descriptionClone.LeftArmColor = bodyColor
    descriptionClone.LeftLegColor = bodyColor
    descriptionClone.RightArmColor = bodyColor
    descriptionClone.RightLegColor = bodyColor

    humanoid:ApplyDescription(descriptionClone)
    for _, playingTracks in pairs(humanoid:GetPlayingAnimationTracks()) do
        playingTracks:Stop()
    end

    local animateScript = humanoid.Parent:WaitForChild('Animate')
    animateScript.run.RunAnim.AnimationId = 'rbxassetid://616163682'        -- Run
    animateScript.walk.WalkAnim.AnimationId = 'rbxassetid://616168032'      -- Walk
    animateScript.jump.JumpAnim.AnimationId = 'rbxassetid://616161997'      -- Jump
    animateScript.idle.Animation1.AnimationId = 'rbxassetid://616158929'    -- Idle (Variation 1)
    animateScript.idle.Animation2.AnimationId = 'rbxassetid://616160636'    -- Idle (Variation 2)

    local ws = humanoid.WalkSpeed
    humanoid.WalkSpeed = 0
    wait(0.05)
    humanoid.WalkSpeed = ws

end)
As per usual, replies that do not contribute to people asking for help may be removed and warned for off-topic posting.
See less See more
  • Like
  • Wow
Reactions: 4
Status
Not open for further replies.
1 - 1 of 1 Posts
1 - 1 of 1 Posts
Status
Not open for further replies.
Top