RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make me sword fight and steal time game, give me the scripts and instructions for it"
-- Sword fighting and time-stealing game consists of multiple parts. Here's a breakdown of the scripts and instructions -- 1. Create a sword and add it to the StarterPack -- Create a new part in the Workspace, name it "Sword" and add necessary components (e.g., mesh, handle, etc.) -- Move the Sword to the StarterPack so that players can pick it up when they spawn -- 2. Create a script for sword fighting -- Add a new script to the Sword and name it "SwordScript" -- Add the following code to the script: local tool = script.Parent local damage = 10 local function onActivated() local character = tool.Parent local humanoid = character:FindFirstChild("Humanoid") if humanoid then local target = humanoid.TargetPoint.Value if target then local targetHumanoid = target.Parent:FindFirstChild("Humanoid") if targetHumanoid then targetHumanoid.Health = targetHumanoid.Health - damage end end end end tool.Activated:Connect(onActivated) -- 3. Create a time-stealing pad -- Create a new part in the Workspace, name it "TimePad" and add necessary components (e.g., mesh, etc.) -- Add a new script to the TimePad and name it "TimeStealScript" -- Add the following code to the script: local part = script.Parent local stealTime = 5 local function onTouched(otherPart) local player = game.Players:FindFirstChild(otherPart.Parent.Name) if player then local playerHumanoid = player.Character:FindFirstChild("Humanoid") if playerHumanoid then playerHumanoid.WalkSpeed = 0 wait(stealTime) playerHumanoid.WalkSpeed = 16 end end end part.Touched:Connect(onTouched) -- Instructions 1. Create a new Roblox game and open it in Roblox Studio. 2. Follow the steps mentioned in the comments above to create the sword, sword fighting script, time-stealing pad, and time-stealing script. 3. Save and publish your game.