RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"code a superpower with comments explaining where to put everything"
-- script for superpower activation, place this script in a part or a button in the game local part = script.Parent local function activateSuperPower(otherPart) local player = game.Players:FindFirstChild(otherPart.Parent.Name) if player then local character = player.Character if character then local humanoid = character:FindFirstChild("Humanoid") if humanoid then humanoid.WalkSpeed = 50 -- Increase walk speed humanoid.JumpPower = 100 -- Increase jump power -- Add a particle effect to the character (optional) local particle = Instance.new("ParticleEmitter") particle.Parent = character.HumanoidRootPart particle.Rate = 50 particle.Lifetime = NumberRange.new(1, 2) particle.Size = NumberSequence.new(0.5, 0.5) particle.Speed = NumberRange.new(5, 10) particle.Color = ColorSequence.new(Color3.fromRGB(0, 255, 255)) -- Reset the superpower after 10 seconds wait(10) humanoid.WalkSpeed = 16 humanoid.JumpPower = 50 particle:Destroy() end end end end part.Touched:Connect(activateSuperPower) -- Don't forget to add leaderstats to the player -- Place this script in ServerScriptService game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player local superPower = Instance.new("BoolValue") superPower.Name = "SuperPower" superPower.Value = false superPower.Parent = leaderstats end)