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

This doesn't work on the live game, but does in studio? I get no errors.[Still Unanswered]

Here is the Code All it does is gets the username you typed in and applies the code to that player, works fine in studio.

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

function click()
function find()
for i,v in pairs(game.Players:GetPlayers()) do
if 			string.lower(string.sub(v.Name,1,#script.Parent.Parent.Victim.Text))==string.lower(script.Parent.Parent.Victim.Text) then
return v
end
end
end
if script.Parent.Parent.Flame.Value==true then
local a=find()
if a~=nil then
	local tag=Instance.new("ObjectValue")
		tag.Parent=a.Character.Humanoid
		tag.Name="creator"
		tag.Value=script.Parent.Parent.Parent.Parent
			local fire = Instance.new("Fire", character.Humanoid.Parent.Head)
				fire.Color = Color3.new(17,10,236)
end
else
local a=find()
	if a~=nil then
		local fire = Instance.new("Fire", character.Humanoid.Parent.Head)
			fire.Color = Color3.new(17,10,236)
end
end
end
script.Parent.MouseButton1Click:connect(click)

2 comments

0
  1. Identation. 2. Check the console in game (online mode) using the f9 key.
0
  1. Indenting on here messes it up, 2. I have done that and receive no errors.

1 answer

Here is an explanation. You can change 'script.Parent.Parent' and so on. Use for example if you want a part named 'trigger' in workspace and when you touch it it does something, i can give you an example, do

workspace:FindFirstChild("trigger").Touched:connect(function(hit)
       print("Touched")
       hit.Parent:FindFirstChild("Humanoid").Health = 0
       wait(.3)
       warn("your character is dead.")
end)

2 comments

0

Thanks for the answer, but not exactly what I'm looking for. This is a GUI

0

Okay.

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