Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Can someone help me?

Ok, so I made a skill in a local script and it works but I need it to do damage, I tried putting in something like this for it to do damage but it didnt work. So I was wondering if someone could help me. I would really appreciate it, and btw I put the skill script also just in case you need it.

 humanoid:TakeDamage(5)
Player = game.Players.LocalPlayer
Char = Player.Character
Torso = Char.Torso
Mouse = Player:GetMouse()

function Move(key)
	key = key:lower()
	if key == "z" then
		print ("z was pressed")
		game.Players.LocalPlayer.Character.Torso.Anchored = true
		for i = 1, 100, 3 do		
			Move = Instance.new("Part")
			Move.Parent = Workspace
			Move.Size = Vector3.new(math.random(4,6), math.random(4,6), math.random(4,6))
			Move.Anchored = true
			Move.TopSurface = 0
			Move.BottomSurface = 0
			Move.BrickColor = BrickColor.new("Brown")
			game.Players.LocalPlayer.Character.Torso.Anchored = false
			y = Instance.new("BodyVelocity")
		    y.maxForce = Vector3.new(math.huge, math.huge, math.huge)
		    y.velocity = Player.Character.Torso.CFrame.lookVector*80
		    Move.Parent = Workspace
		    y.Parent = Move
    	    Move.CFrame = Player.Character.Torso.CFrame*CFrame.new (0, 0, -12)*CFrame.new (0,0,-i)CFrame.Angles(math.random(), math.random(), math.random())
			wait()			
		end
	end
end
Mouse.KeyDown:connect(Move)

1 comment

0

I just did

1 answer

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

Above would explain why it would not work in server, but if it does not work in studio reply the error codes.

This discussion is preserved as it was. New answers, comments, and votes are closed.