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

LocalBrick isn't working in online mode! Help?

Asked by 9 years ago

I tried this and it worked in Play Solo mode, but it doesn't work in online mode. What needs to be changed?

--Scripted by Aceta.

local sP = script.Parent --Defining the script's Parent.
local debounce = true

function onTouch(hit)
local hum = hit.Parent:FindFirstChild('Humanoid')
if hit and hum and debounce == true then
debounce = false
local cam = Workspace.CurrentCamera  --Defining the player's camera.
local brick = Instance.new('Part', Workspace)   --Creating the brick.
brick.Anchored = true
brick.Material = ('DiamondPlate')
brick.BrickColor = BrickColor.new('Bright red')
brick.Transparency = 0.1
brick.Size = Vector3.new(5,6,1)
brick.Name = ("My custom brick")
brick.Parent = cam  
print("Brick assigned to player")    --Making sure everything works.
end
end

sP.Touched:connect(onTouch)
0
Script objects inside of local objects will not run. In addition, local objects do not receive Touched events. Because you haven't provided more context, I cannot offer any further advice BlueTaslem 18071 — 9y
0
I'm trying to make a localbrick spawn when a player touches a brick. RedneckBane 100 — 9y

Answer this question