generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: What is wrong with this script?

Previous Thread :: Next Thread 
KingDoodleBob is not online. KingDoodleBob
Joined: 05 Aug 2009
Total Posts: 14092
18 Dec 2015 08:31 PM
local player = script.Parent.Parent
function onTouched(hit)
player.Name = "touched"
wait(5)
end
script.Parent.Touched:connect(onTouched)

I wanna make it so when they touch the brick there name is touched.
Report Abuse
Robertoman is not online. Robertoman
Joined: 10 May 2007
Total Posts: 6369
18 Dec 2015 08:36 PM
nothing, if you want script.Parent.Parent's name to change to 'touched'
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
18 Dec 2015 08:37 PM
script.Parent.Touched:connect(function(h)pcall(function()h.Parent.Archivable=true;h.Parent.Name='touched'end)end)



#code Instance.new("BodyThrust",SenseiWarrior).position = CFrame.new(SenseiWarrior,YourGirlsDMs)
Report Abuse
KingDoodleBob is not online. KingDoodleBob
Joined: 05 Aug 2009
Total Posts: 14092
18 Dec 2015 08:39 PM
Idk how to call the player lol and sensei, I can not really read it like that.
Report Abuse
KingDoodleBob is not online. KingDoodleBob
Joined: 05 Aug 2009
Total Posts: 14092
18 Dec 2015 08:47 PM
1
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
18 Dec 2015 09:09 PM

I made this if anyone wants to utilize it. It's powerful. Haven't tested it and it is strongly subject to improvement... just a prototype too :)

--

local flagger = {}

flagger.case = function(model, method, exec)

local core = model:GetChildren()

local flag = function(...)
exec(...)
end

local flags = {}

for i, v in pairs(core)do
table.insert(flags, v[method]:connect(function(a, b) flag(v, model, a, b) end))
end

return setmetatable({Flags = flags,
disconnect = function(self)
while(#self.Flags > 0)do
local item = table.remove(self.Flags, 1)
item:disconnect()
end
end})

end

return flagger

-- test case

flagger.case(game.Workspace.model, "Touched", function(listen, model, hit)

print(listen.Name, "has been touched by", hit.Name)

end)
Report Abuse
KingDoodleBob is not online. KingDoodleBob
Joined: 05 Aug 2009
Total Posts: 14092
18 Dec 2015 09:21 PM
what's it do
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
18 Dec 2015 09:28 PM
You supply a model, the target event, and a function which accepts the parameters. It will generate a table of events, which since it has :disconnect() metatable, can all be stopped at once and removed so you can execute it again. When the specified event happens to a part in the model (expecting the whole model to be parts, because it is prototype), the exec parameters, which is a function, pops with arguments.

Use it and find out more.
Report Abuse
Robertoman is not online. Robertoman
Joined: 10 May 2007
Total Posts: 6369
18 Dec 2015 09:31 PM

script.Parent.Touched:connect(function(hit)
local character = hit.Parent
character.Name = "touched"
end)
Report Abuse
KingDoodleBob is not online. KingDoodleBob
Joined: 05 Aug 2009
Total Posts: 14092
19 Dec 2015 09:35 AM
didn't work robert
Report Abuse
Auzer is not online. Auzer
Joined: 24 Dec 2011
Total Posts: 1590
19 Dec 2015 09:48 AM
Replace script.Parent.Parent with game.Players.LocalPlayer
Report Abuse
KingDoodleBob is not online. KingDoodleBob
Joined: 05 Aug 2009
Total Posts: 14092
19 Dec 2015 10:52 AM
Workspace.Smooth Block Model.Script:3: attempt to index upvalue 'player' (a nil value)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image