Relative Content

Tag Archive for roblox-studio

I made a function, but got an ‘expected identifier when parsing expression, got ‘=” error

clickdetector = script.Parent.ClickDetector newPart = Instance.new(‘Part’, workspace) newPart:Destroy() function createPushBlock(): newPart = newPart newPart.BrickColor = ‘Neon orange’ end clickdetector.MouseClick:Connect(createPushBlock()) I tried to search information in devforum, but i didn’t find a useful solution I expected it to spawn a new part once part is clicked roblox-studio New contributor s_ecialkai is a new contributor to this […]

Roblox studio scripting

I watched a tutorial on how to make a tower defense game(from gnomecode),i need help,I stopped at 6# video on how to make tower placement, but when I finished making the script and checked everything seemed fine, but when i clicked on tower name gui button it started to spam errors in output like Players.Playername.PlayerGui.GameGui.GameController:96: attempt to index nil with ‘Size’
Here is the game controller script(The render part(96 line is local y)
RunService.RenderStepped:Connect(function()
if towerToSpawn then
local result = MouseRaycast({towerToSpawn})
if result and result.Instance then
if result.Instance.Parent.Name == “TowerArea” then
canPlace = true
ColorPlaceholderTower(Color3.new(0,1,0))
else
canPlace = false
ColorPlaceholderTower(Color3.new(1,0,0))
end
local x = result.Position.X
local y = result.Position.Y + towerToSpawn.Humanoid.HipHeight + (towerToSpawn.PrimaryPart.Size.Y * 2)
local z = result.Position.Z