I'm trying to make a plugin, I want it to create a script with the following code:
local Brick = script.Parent
local function PlayerTouched(Part)
local Parent = Part.Parent
if game.Players:GetPlayerFromCharacter(Parent) then
Parent.Humanoid.Health = Parent.Humanoid.Health - 100 --damage
end
end
Brick.Touched:connect(PlayerTouched)
Altho it wont work:
local Somescript = Instance.new("Script")
Somescript.Source = "local Brick = script.Parent
local function PlayerTouched(Part)
local Parent = Part.Parent
if game.Players:GetPlayerFromCharacter(Parent) then
Parent.Humanoid.Health = Parent.Humanoid.Health - 100 --damage
end
end
Brick.Touched:connect(PlayerTouched)"
I can only write
local Somescript = Instance.new("Script")
Somescript.Source = "local Brick = script.Parent local function PlayerTouched(Part)... "
Plz help! :(

1 comment
lol you put a " before local on line 2