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

How do I make this hammer not Invisible? Problem with FilteringEnabled

FilteringEnabled is On. I have made a Local Script where it clones the Hammer when pressing "g". I am wondering how do I make that hammer not invisible? Transparency is 0 by the way. I think I need to somehow copy that hammer in to the server but I am not sure on how to do that. I'm not sure though.

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

Mouse.KeyDown:connect(function(key)
	key = key:lower()
	if key == "g" then
		local anim = Player.Character.Humanoid:LoadAnimation(script.Animation)
		game:GetService("Chat"):Chat(Player.Character.Head, "BLESSED HAMMER!", "Blue")
		local x = game.ReplicatedFirst.Hammer.Handle:Clone()
		x.Parent = game.Workspace
		x.Name = "NotIceHammer"		
		x.Anchored = false
		x.CanCollide = true
		
		x.CFrame = Player.Character.Head.CFrame*CFrame.new(0,6.5,4)*CFrame.Angles(0,math.pi/2,2*math.pi/9)
		local pe = Instance.new("ParticleEmitter", x) --Make the Hammer look Blessful-ly
		pe.Size = NumberSequence.new(0,2.62)
		pe.Texture = "rbxassetid://1205087993"
		pe.EmissionDirection = Enum.NormalId.Back
		pe.SpreadAngle = Vector2.new(0,360)
		pe.Lifetime = NumberRange.new(2.5)
		pe.Rate = 100
		pe.LightEmission = 0.1
		pe.Lifetime = NumberRange.new(.5)
		pe.Speed = NumberRange.new(.2)
		pe.Transparency = NumberSequence.new(.7)
		local bv = Instance.new("BodyVelocity", x) --To Counteract the gravity pulling the hammer down
		bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
		bv.Velocity = Player.Character.Head.CFrame.upVector*0
		local bv = Instance.new("BodyVelocity", x)
		bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
		bv.Velocity = Player.Character.Head.CFrame.upVector*0
		game.Debris:AddItem(x, .5)
		print("MaybeWorking")
		anim:Play()
		--Make The Hammer Follow the Humanoid's Arms--		
		wait(.5)
		local x = game.ReplicatedFirst.Hammer:Clone()
		x.Parent = Player.Character
		x.GripForward = Vector3.new(1,0,0)
		x.GripPos = Vector3.new(0,-2,0)
		x.GripRight = Vector3.new(1,0,1)
		wait(.8)
		x.GripRight = Vector3.new(0,0,1)
		--Fix Animation with Arm. Arm is crooked, Make it upright--
		game.Debris:AddItem(x, 5)
	end
end)

1 answer

DO NOT USE KEYDOWN TO GET THE USER INPUT NEVER USE THE MOUSE. and if you want to get the player do game:GetService to get ANY service.

so instead of Mouse.KeyDown:connect do

game:GetService(“UserInputService”).InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.G then

3 comments

0

Thanks for the tip. What Service would I use to make the hammer not invisible though?

0

You need to use remote events and create your whole hammer and what not through a script not a local script

0

I would put all of the hammer stuff from this script and move it to a "Script" and into ServerScriptService. Right?

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