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

Why the part material not chaged be to plastic?

script.Parent.Parent.Block.Touched:Connect(function(Part)
	workspace.PartStorage.Part.Changed = Enum.Material.Concrete
end)

ehh, hello ^w^ just make a script and what are me doing after the script has completed ^w^

thanks >w^

4 comments

2

^w^

2

^w^

2

^w^

2

^w^ Changed is an event, just access the Material of the part instead

2 answers

✓ Accepted answer

There is no need to make Part for a neutral function. Change to function() instead.

I think you meant why is the part is plastic? Easy fix. Consider replacing . Changed to . Material instead.

Need a script?

script.Parent.Parent.Block.Touched:Connect(function()
	workspace.PartStorage.Part.Material = Enum.Material.Concrete
end)

2 comments

0

thanks you so much ^w^

0

no problem ^w^

A I can see, You should Change function(Part) into function(hit)

The hit function is activated, When the player is touching it's part. I will show the script:

script.Parent.Parent.Block.Touched:Connect(function(hit)
       local h = hit.Parent:FindFirstChild("Humanoid") -- Humanoid
       if h ~= nil then
             Workspace.PartStorage.Part.Material = Enum.Material.Concrete
       end
end)

Here is some errors:

First of all, .Changed is an event which Activated when something changes

Second, Workspace starts with Capital W, Workspace.


And Please Note: This is a script for Humanoids [Players or NPCs] Which has Humanoid. This doesn't work Unless the Humanoid is not Parented to the Object which needs to Touch.

I hope it Help!

2 comments

1

Actually, using "Workspace" with the capital 'W' is deprecated. "workspace" is the correct variable, with a lowercase 'W'

1

Why are you adding in code to check for a humanoid? It's unneeded.

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