Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago
Edited 6 years ago

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)
0
1. Identation. 2. Check the console in game (online mode) using the f9 key. RubenKan 3615 — 6y
0
1. Indenting on here messes it up, 2. I have done that and receive no errors. GuestRealization 102 — 6y

1 answer

Log in to vote
0
Answered by
RootEntry 111
6 years ago

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)
0
Thanks for the answer, but not exactly what I'm looking for. This is a GUI GuestRealization 102 — 6y
0
Okay. RootEntry 111 — 6y
Ad

Answer this question